【发布时间】:2019-07-04 14:37:41
【问题描述】:
我正在使用 EFK 日志堆栈,并设法设置了 fluentd 过滤器和匹配配置,以便在 Kibana 中收集的 tomcat 访问日志所有需要的字段都在那里:IP、纬度、经度、城市、国家代码等。
我有curl -XPUT -H "Content-Type: application/json" --data @fluentd_mapping.json http://$host/fluentd/fluentd/_mapping,但它只影响流利的索引。不是动态创建的每日日志索引<foo>.access.logs.*
所以我的问题是如何应用映射,以便 geo_point 类型对每日日志索引有效?谢谢。
我重新启动了 ES 容器 curl -XPUT 以下 mapping.json 被 fluentd 索引而不是日常日志索引拾取:
{
"fluentd": {
"location_array": {
"type": "geo_point"
},
"location_properties": {
"type": "geo_point"
},
"location_string": {
"type": "geo_point"
},
}
}
现有模板:
"dynamic_templates": [{
"kibana_index_template:.kibana": {
"dynamic_templates": [{
"security-index-template": {
"dynamic_templates": [{
"path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.search\\.request\\.(body|template)",
"logstash-index-template": {
现有索引模式:
"index_patterns": [".monitoring-logstash-6-*"],
"index_patterns": [".monitoring-kibana-6-*"],
"index_patterns": [".ml-anomalies-*"],
"index_patterns": [".kibana"],
"index_patterns": [".ml-state"],
"index_patterns": [".watches*"],
"index_patterns": [".monitoring-beats-6-*"],
"index_patterns": [".monitoring-es-6-*"],
"index_patterns": [".security_audit_log*"],
"index_patterns": [".ml-meta"],
"index_patterns": [".security-*"],
"index_patterns": [".triggered_watches*"],
"index_patterns": [".watcher-history-9*"],
"index_patterns": [".monitoring-alerts-6"],
"index_patterns": [".ml-notifications"],
"index_patterns": [".logstash"],
我添加了以下模板但无济于事:
"fluentd": {
"order": 0,
"index_patterns": ["myapp.access.logs*"],
"settings": {},
"mappings": {
"fluentd": {
"properties": {
"location_array": {
"type": "geo_point"
},
"location_properties": {
"type": "geo_point"
},
"location_string": {
"type": "geo_point"
}
}
}
},
"aliases": {}
},
myapp.access.logs 没有接收到它-
【问题讨论】:
-
在您添加的模板中,只需将“fluentd”更改为“_doc”即可。
标签: elasticsearch kibana fluentd geopoints