How to creating Map View in Kibana using Latitude and Longitude imported from Logstash?

Hi
I am trying to create a map view in Kibana using Latitude and Longitude. I have been following posts online saying I need to have my Latitude and Longitude combined into 1 field. However, I am still unable to choose the 'Location' field as my coordinates, can anyone help me?

Logstash file:

csv {
    separator => ","
    columns => ["Disk Location","Hash","Date","Latitude","Longitude","Somethingelse","other"]

}
mutate {convert => ["Disk Location", "integer"]}
mutate {add_field => ["location", "%{Latitude},%{Longitude}"]}

}

Thanks

Hey @Ac3,

What you need is a geo_point field (here are the docs).

Essentially, you want this:

PUT my_index/_doc/1
{
  "text": "Geo-point as an object",
  "location": { 
    "lat": 41.12,
    "lon": -71.34
  }
}

with location being a property in the index mapped as geo_point:

PUT my_index
{
  "mappings": {
    "properties": {
      "location": {
        "type": "geo_point"
      }
    }
  }
}

Hi @Larry_Gregory

Thanks for your reply, this is one of the things which has confused me.... I am importing a set of values from CSV and have Latitude Longitude set as a set of values. How do I tell Logstash these are the values I want to use?
Is it like so ?

   else if [path] == "C:/ProgramData/FDA/output/processed/gpsbe.csv"{
    	csv {
            separator => ","
            columns => ["Disk Location","Hash","Date","Latitude","Longitude","Somethingelse","other"]

    }
	mutate {convert => ["Disk Location", "integer"]}
	mutate {add_field => ["location", "%{Latitude},%{Longitude}"]}

}

PUT map
{
  "text": "Geo-point as an object",
  "location": { 
    "lat": Latitude,
    "lon": Longitude
  }
}

You'll have better luck asking in the Logstash topic on that, but could you do something like this?

mutate {add_field => ["location.lat", "%{Latitude}"]}
mutate {add_field => ["location.lon", "%{Longitude}"]}

Yeah, that's what I want to achieve, thanks for your help anyway :slight_smile:

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