0
votes

How to stash input values such as lat and lon to create geoshape point before output to elasticsearch example need to output to elasticsearch as "location": { "type": "point", "coordinates": [-84.636,33.33] } For generating the above what code what filter should add in logstash conf file?

1

1 Answers

0
votes

guys got the answer for this after a long search. its like this If you want to stash lat lon in to elasticsearch which already has mapping as

"location": {
            "type": "geo_shape"
          }

On your conf file in logstash you will have to use the filter mutate

mutate {
     add_field => { "[location][type]" => "point"
                    "[location][coordinates]" => ["%{LocationDataLng}",
                    "%{LocationDataLat}"]
     }
   }