# Add geo\_shape polygon coordinates with Logstash

**URL:** <https://discuss.elastic.co/t/add-geo-shape-polygon-coordinates-with-logstash/237651>\
**Category:** Logstash\
**Created:** [June 18, 2020, 1:50pm UTC](https://discuss.elastic.co/t/add-geo-shape-polygon-coordinates-with-logstash/237651 "2020-06-18T13:50:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Attic](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@Attic](https://discuss.elastic.co/u/Attic)\
**Post date:** [June 18, 2020, 1:50pm UTC](https://discuss.elastic.co/t/add-geo-shape-polygon-coordinates-with-logstash/237651/1 "2020-06-18T13:50:46Z")

</div>

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:

```auto
    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.

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [June 18, 2020, 9:38pm UTC](https://discuss.elastic.co/t/add-geo-shape-polygon-coordinates-with-logstash/237651/2 "2020-06-18T21:38:39Z")

</div>

Hi @Attic. I think you will need to [write a custom filter for Logstash](https://www.elastic.co/guide/en/logstash/current/filter-new-plugin.html) to accomplish this. For example, a community member created [logstash-filter-geojson](https://github.com/nreese/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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 16, 2020, 9:38pm UTC](https://discuss.elastic.co/t/add-geo-shape-polygon-coordinates-with-logstash/237651/3 "2020-07-16T21:38:41Z")

</div>

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