logstash-6.2.4
elasticsearch-6.2.4
Here is the filter configuration in logstash:
geoip {
source => "src_ip"
target => "geoip"
database => "/usr/share/GeoIP/GeoLite2-City.mmdb"
add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
}
mutate {
convert => [ "[geoip][coordinates]", "float"]
}
And this is the geoip.location definition in elasticsearch mappings:
"location": {
"properties": {
"lat": {
"type": "float"
},
"lon": {
"type": "float"
}
}
If I applied mappings to es:
PUT my_index
{
"mappings": {
"_doc": {
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
}
Another error happened:
[geoip.location] is defined as an object in mapping [doc] but this name is already used for a field in other types
This is not a new problem. However I can't find the workable solution from the discussion forum