# Painful! postgres--\>logstash--\>elasticsearch mapper\_parsing\_exception!

**URL:** https://discuss.elastic.co/t/painful-postgres-logstash-elasticsearch-mapper-parsing-exception/44918
**Category:** Elasticsearch
**Created:** [March 20, 2016, 3:23am UTC](https://discuss.elastic.co/t/painful-postgres-logstash-elasticsearch-mapper-parsing-exception/44918 "2016-03-20T03:23:05Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![past2010yeah](https://avatars.discourse-cdn.com/v4/letter/p/c4cdca/32.png) [@past2010yeah](https://discuss.elastic.co/u/past2010yeah)
#### Post date: [March 20, 2016, 3:23am UTC](https://discuss.elastic.co/t/painful-postgres-logstash-elasticsearch-mapper-parsing-exception/44918/1 "2016-03-20T03:23:05Z")

</div>

hi, I am so sorry to bother you, but now I am painful and rage about  
a problem. the problem has spent more that one weeks. and so sad I  
cann't find any useful information, anyone any comments and suggestions, I really appreciate that.

logstash 2.1.1 , elasticsearch 2.1.1 , and postgres 9.3 is the versions I used.

I think the problem is elasticsearch can't parse the geojson string data I exported from postgres. the elasticsearch want to parse an object. ☹

The exception information is(when I start the logstash) :

 ![](https://us1.discourse-cdn.com/elastic/original/2X/4/48136926cf9db69f1ddc2a2b2c0884480a54e2f3.png)  
Firstly: logstash is used to export data from postgres. and my cocnfiguration file is :

input {

```
jdbc {

    # Postgres jdbc connection string to our database, mydb

    jdbc_connection_string => "jdbc:postgresql://...:5432/handle_service"

    # The user we wish to execute our statement as

    jdbc_user => "user"

    jdbc_password => " *****"

    # The path to our downloaded jdbc driver

    jdbc_driver_library => "/home/admin/dataservice-search/elasticsearch-2.1.1/lib/postgresql-9.3-1102-jdbc41.jar"

    # The name of the driver class for Postgresql

    jdbc_driver_class => "org.postgresql.Driver"

    parameters => { "favorite_artist" => "Beethoven" }

    schedule => " * * * "

    # our query

    statement => " select st_asgeojson(st_makevalid(geom)) As geometry_offset_geo , from t_delete_road limit 20"

    type => "datasearch"

}

```

}

output {

```
stdout {codec => rubydebug }

    elasticsearch {

    index => "datasearch"

    document_type => "datasearch"

    document_id => "%{id}"

    hosts => ["...:9200"]

}

```

}

second, I created the index in the elasticsearch:

```
curl -XPOST http://...:9200/datasearch/datasearch/_mapping -d '{
"datasearch":{
               "properties" : {
                       "geometry_offset_geo":{
                                             "type":"geo_shape",
                                             "tree":"quadtree",
                                            "precision":"1m"
                                                  }
                                        }
                        }

```

} '

third, I start the logstash. and then something was wrong.

But it's works when I use

curl -XPOST 'http://...:9200/datasearch/datasearch/1' -d '{"geometry":{

"type":"Polygon",

"coordinates":[

[[-85.0018514,37.1311314],

[-85.0016645,37.1315293],

[-85.0016246,37.1317069],

[-85.0016526,37.1318183],

[-85.0017119,37.1319196],

[-85.0019371,37.1321182],

[-85.0019972,37.1322115],

[-85.0000002,37.1317672]]]

}

}'

I really wonder what happen among those steps. so I come here and ask for some help, please.

It's so important to me to solve this problem.  
thanks in advance.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [March 20, 2016, 3:30am UTC](https://discuss.elastic.co/t/painful-postgres-logstash-elasticsearch-mapper-parsing-exception/44918/2 "2016-03-20T03:30:02Z")

</div>

> [@past2010yeah](#):
>
> "coordinates"=\>[[#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#,
> 
> ], [#, #], [#, #]]}, "id"]}\>\>],

Is that the actual data or have you changed the error?

---

<div class="post-metadata">

### Author: ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)
#### Post date: [March 20, 2016, 1:26pm UTC](https://discuss.elastic.co/t/painful-postgres-logstash-elasticsearch-mapper-parsing-exception/44918/3 "2016-03-20T13:26:02Z")

</div>

> [@past2010yeah](#):
>
> I think the problem is elasticsearch can't parse the geojson string data I exported from postgres

FYI my JDBC importer [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-jdbc) can parse GeoJSON points and shapes from PostgreSQL.

If there are problems, you can ask for help at [Issues · jprante/elasticsearch-jdbc · GitHub](https://github.com/jprante/elasticsearch-jdbc/issues)

---

<div class="post-metadata">

### Author: ![past2010yeah](https://avatars.discourse-cdn.com/v4/letter/p/c4cdca/32.png) [@past2010yeah](https://discuss.elastic.co/u/past2010yeah)
#### Post date: [March 21, 2016, 1:50am UTC](https://discuss.elastic.co/t/painful-postgres-logstash-elasticsearch-mapper-parsing-exception/44918/4 "2016-03-21T01:50:55Z")

</div>

Actually I did. But I got the same error. so I want to know if my conf file has something wrong. I really need some help. The geometry data is sotred in the db like this :

"0101000020E6100000CDCCCCCC2D835E408C25BF58A6054A40"

and I read it in the logstash using the follow sentences:

select st\_asgeojson(st\_makevalid(geom)) As geometry\_offset\_geo , from t\_delete\_road limit 20

and elasticsearch-jdbc-2.1.1.2 is my choice.

thanks in advance, any comments I will appreciate that.

---

<div class="post-metadata">

### Author: ![past2010yeah](https://avatars.discourse-cdn.com/v4/letter/p/c4cdca/32.png) [@past2010yeah](https://discuss.elastic.co/u/past2010yeah)
#### Post date: [March 21, 2016, 3:46am UTC](https://discuss.elastic.co/t/painful-postgres-logstash-elasticsearch-mapper-parsing-exception/44918/5 "2016-03-21T03:46:51Z")

</div>

sorry, I corrected that. and thank you!

---

<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 5, 2017, 11:06pm UTC](https://discuss.elastic.co/t/painful-postgres-logstash-elasticsearch-mapper-parsing-exception/44918/6 "2017-07-05T23:06:43Z")

</div>


