How to construct geo_point field from separate fields of latitude and longitude for Kibana 7.6?

From input csv data I have 2 fields of location - lat and long.
How can I construct a geo_point location field to create map visualization in logstash config (version 7.6)?

Thank you.
' ' ' '

filter {

csv{
separator => ";"
columns => ["Province/State","Country/Region","Lat","Long","Date","Cases","Deaths"]
skip_empty_columns => "true"
skip_header => "true"
}

mutate{
convert => { "Cases" => "integer" }
convert => { "Deaths" => "integer" }
}

mutate{
convert => { "Lat" => "float" }
convert => { "Long" => "float" }
}

date {
match => [ "Date", "dd/MM/yyyy" ]
timezone => "UTC"
target => "@timestamp"
}
}

@yassine_belhajali you need to do two things:

  1. Define a geo_point field in the mapping of the index set to receive this data
  2. Concatenate the lat/lon pair into a single field that adheres to one the five allowable formats.

For #2, I tend to just do something like:

mutate{
  add_field => {"location" => "%{lat},%{lon}"}
  remove_field => ["lat", "lon"]
}

I added location field in the mapping using a template, changed my code like this :

 mutate{
    rename => {
	"Long" => "[locations][lon]"
	"Lat" => "[locations][lat]"
    }
 }

Then it works :v:
Thanks.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.