For passing geographical data to elasticsearch, there is a need to create a logstash filter to process the field referencing the IP address, and creating new field(s) with geographical data.
Based on this article How To Map User Location with GeoIP and ELK?
My new /etc/logstash/conf.d is:
filter {
geoip {
source => "source_ip"
target => "geoip"
database => "/etc/logstash/GeoLiteCity.dat"
add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
}
mutate {
convert => [ "[geoip][coordinates]", "float"]
}
}
After applying this log, there is a need to restart logstash and double check the logs at /var/log/logstash.
So the end result is:
