【发布时间】:2019-03-11 03:40:55
【问题描述】:
我们正在尝试寻找如何将来自 AWS WAF/Kinesis Firehose 的时间戳转换为 Elasticsearch,使其类型为日期字段。创建索引映射时,它具有时间戳字段,但它是long 类型,尽管似乎有epoch_millis 类型的选项(这就是数据)。
Kibana 界面说使用映射 api 来更改字段类型,但我似乎无法弄清楚这一点。示例 here 展示了如何通过创建新索引来执行此操作,但 kinesis 正在创建/旋转索引,因此我们似乎需要一种方法来修改默认值。
字段如下所示
"timestamp": {
"type": "long"
},
完整的索引定义看起来像这样,但这些又是定期创建的,所以我们试图弄清楚如何更改默认值
"waf-prod-2018-10-05": {
"mappings": {
"waf-prod": {
"properties": {
"action": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"formatVersion": {
"type": "long"
},
"httpRequest": {
"properties": {
"args": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"clientIp": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"country": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"headers": {
"properties": {
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"value": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"httpMethod": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"httpVersion": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"uri": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"httpSourceId": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"httpSourceName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"nonTerminatingMatchingRules": {
"properties": {
"action": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"ruleId": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"rateBasedRuleList": {
"properties": {
"limitKey": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"maxRateAllowed": {
"type": "long"
},
"rateBasedRuleId": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"terminatingRuleId": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"terminatingRuleType": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"timestamp": {
"type": "long"
},
"webaclId": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
},
【问题讨论】:
标签: amazon-web-services elasticsearch amazon-kinesis-firehose amazon-waf