我可以在默認映射geoip.location看到被映射到geo_point類型:logstash geoip.location映射到geo_point不工作
GET myserver:9200/_template
{
"logstash": {
"order": 0,
"version": 50001,
"template": "logstash-*",
"settings": {
"index": {
"refresh_interval": "5s"
}
},
"mappings": {
"_default_": {
"dynamic_templates": [
{
"message_field": {
"path_match": "message",
"mapping": {
"norms": false,
"type": "text"
},
"match_mapping_type": "string"
}
},
{
"string_fields": {
"mapping": {
"norms": false,
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"match_mapping_type": "string",
"match": "*"
}
}
],
"_all": {
"norms": false,
"enabled": true
},
"properties": {
"@timestamp": {
"include_in_all": false,
"type": "date"
},
"geoip": {
"dynamic": true,
"properties": {
"ip": {
"type": "ip"
},
"latitude": {
"type": "half_float"
},
"location": {
"type": "geo_point"
},
"longitude": {
"type": "half_float"
}
}
},
"@version": {
"include_in_all": false,
"type": "keyword"
}
}
}
},
"aliases": {}
}
}
我有這樣的一個logstash過濾器從一個獲取GeoIP的數據我的字段:
geoip {
source => "myField"
add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
}
mutate {
convert => [ "[geoip][coordinates]", "float"]
}
另外,如果我嘗試使用kibana地圖可視化,它說「不兼容的字段」
爲什麼不是默認的映射工作?
編輯: 我也試過只是geoip { source => "myfield"}
,因爲我的默認映射是使用位置,而不是座標,但這是行不通的。
我也擺脫了發生變異,並試圖這樣,但它無法正常工作或:
geoip {
source => "myfield"
add_field => [ "[geoip][location]", "%{[geoip][longitude]}" ]
add_field => [ "[geoip][location]", "%{[geoip][latitude]}" ]
}
錯在哪裏? – red888
你在一個地方的座標和另一個地方的座標。另外2點也適用 – Alcanzar
酷我所有這一切註釋掉測試,如果映射已經建立正確的默認,也許我只需要geoip的{源=>「MyField的」},並沒有別的 – red888