【发布时间】:2017-11-03 13:02:49
【问题描述】:
我正在使用基于解决方案的 Docker Compose 运行 ElasticSearch、Logstash 和 Kibana:https://github.com/deviantony/docker-elk。
我正在按照本教程尝试在处理我的网络日志时添加 geoip 信息:https://www.elastic.co/blog/geoip-in-the-elastic-stack。
在 logstash 中,我正在处理来自 FileBeat 的文件,并且我已将 geoip 添加到我的过滤器中:
filter {
...
geoip {
source => "client_ip"
}
}
当我在 Kibana 中查看文档时,它们确实包含其他信息,例如 geoip.country_name、geoip.city_name 等,但我希望我的索引中的 geoip.location 字段类型为 geo_point。
我看到的是location.lat 和location.lon,而不是geo_point。为什么我的位置不是geo_point 类型?我需要某种映射等吗?
ingest-common、ingest-geoip、ingest-user-agent 和 x-pack 在 ElasticSearch 启动时加载。我在 Kibana 中刷新了我的索引的字段列表。
EDIT1:
根据@Val 的回答,我正在尝试更改索引的映射:
PUT iis-log-*/_mapping/log
{
"properties": {
"geoip": {
"dynamic": true,
"properties": {
"ip": {
"type": "ip"
},
"location": {
"type": "geo_point"
},
"latitude": {
"type": "half_float"
},
"longitude": {
"type": "half_float"
}
}
}
}
}
但这给了我这个错误:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "mapper [geoip.ip] of different type, current_type [text], merged_type [ip]"
}
],
"type": "illegal_argument_exception",
"reason": "mapper [geoip.ip] of different type, current_type [text], merged_type [ip]"
},
"status": 400
}
【问题讨论】:
标签: elasticsearch logstash geoip