Postgresql problem parse geomretry

Hello,

need help with logstash parser...

and postgresql query:

SELECT st_asgeojson(st_makevalid(jj.point)) AS location FROM table

{
  "_index": "test",
  "_type": "doc",
  "_id": "1111",
  "_version": 1,
  "_score": null,
  "_source": {
    "type": "testt",
    "description": "testt",
    "@version": "1",
    "location": "{\"type\":\"Point\",\"coordinates\":[15.9774477559483,45.8111717248469]}",
 "fields": {
    "@timestamp": [
      "2015-12-06T10:10:08.171Z"
    ]
  },
  "sort": [
    1544091008171
  ]
}

I need parse "location" to:

{
    "location" : {
        "type" : "point",
        "coordinates" : [-77.03653, 38.897676]
    }
}

But I get in index:

"location": "{"type":"Point","coordinates":[15.9774477559483,45.8111717248469]}",

In logstash config i use:

filter {
  json {
    source => "location"
    target => "json"  
  }
}

and get

 "json": {
      "coordinates": [
        18.8057406022342,
        45.2884932853786
      ],
      "type": "Point"
    },

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