Remove Latitude and Longitude from a cell in a CSV for geo_point visualization

Finally we are on the same page :smiley: OK, so that grok still works

    csv { autodetect_column_names => true }
    grok { match => { "Location" => "\(%{NUMBER:[location][lat]:float}, %{NUMBER:[location][lon]:float}\)" } }

will get you

                              "Location" => "1051 DIX AVENUE\r HUDSONFALLS, NY 12839\r (43.319290299000045, -73.59206215299997)",
                              "location" => {
    "lat" => 43.319290299000045,
    "lon" => -73.59206215299997
},

If there is no lat/lon inside parentheses in the Location field you get a _grokparsefailure instead.

Your next problem is to update the template for your index to tell it that the location field is a geo_point. There are two example of how you could do that in previous releases (dynamic and non-dynamic) in this thread. However templates are changing. If those example do not work then ask a new question in the elasticsearch forum about how to configure a template that makes location a geo_point.

1 Like