Add geo_shape polygon coordinates with Logstash

Hello everyone,

I'm using the JDBC connector to read IDs from a DB.
These IDs are spots around the world that mark the center of a polygon.

Is it possible to bind the polygon edge coodinates to a spot-id using Logstash, to make them appear in Maps so I can create a layer from them?

I'm currently thinking about something like the following for Logstash:

    input {
      jdbc {
        ...
      }
    }
    
    filter {
      if [spot_id] == "10"
        mutate {
          add_field => { "polygon_edge1" => "51.13,11.96"}
          add_field => { "polygon_edge2" => "53.15,12.80"}
          ...
        }
    }

    output {
      elasticsearch {
        ...
      }
    }

Thanks in advance for your help.

Hi @Attic. I think you will need to write a custom filter for Logstash to accomplish this. For example, a community member created logstash-filter-geojson that attempts to do something similar. This plugin is not supported or developed by Elastic, but it is a useful example of how to create a custom filter.

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