# Problem converting latitude and longitude from jdbc to elastic geo\_point using logstash

**URL:** <https://discuss.elastic.co/t/problem-converting-latitude-and-longitude-from-jdbc-to-elastic-geo-point-using-logstash/188609>\
**Category:** Logstash\
**Created:** [July 3, 2019, 5:27am UTC](https://discuss.elastic.co/t/problem-converting-latitude-and-longitude-from-jdbc-to-elastic-geo-point-using-logstash/188609 "2019-07-03T05:27:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![roebe](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@roebe](https://discuss.elastic.co/u/roebe)\
**Post date:** [July 3, 2019, 5:27am UTC](https://discuss.elastic.co/t/problem-converting-latitude-and-longitude-from-jdbc-to-elastic-geo-point-using-logstash/188609/1 "2019-07-03T05:27:33Z")

</div>

Hi, having issues running a logstash config which is supposed to convert lat and lon into a field type geo\_point

my current config file looks like:

```
jdbc_user => "elastic"
statement => "SELECT * FROM mChoice_TotalPartnerElasticSearchView"
  }
}

filter {
	mutate {
		add_field => { "[location][lat]" => "%{[lat]}" }
		add_field => { "[location][lon]" => "%{[lon]}" }
	}
 
mutate {
   convert => {
       "[location][lat]" => "float"
       "[location][lon]" => "float" 
    }
}
}
   

output {
  elasticsearch {
hosts => ["localhost:9200"]
index => "totalpartners"
	document_type => "_doc"
	document_id => "%{[partnerid]}"
  }
}

```

my mapping looks like:

```
    "properties": {
       "Address": {
          "type": "text"
       },
       "AddressAdd": {
          "type": "text"
       },
       "City": {
          "type": "keyword"
       },
       "Contact": {
          "type": "text"
       },
       "Country": {
          "type": "keyword"
       },
       "EMail": {
          "type": "keyword"
       },
       "Location": {
                "type": "geo_point"
        
       },
       "Name": {
          "type": "completion"
       },
       "NameAdd": {
          "type": "text"
       },

```

my Error looks like:

```
[2019-07-03T05:01:53,450][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>"10002", :_index=>"totalpartners", :_type=>"_doc", :routing=>nil}, #<LogStash::Event:0x5661e171>], :response=>{"index"=>{"_index"=>"totalpartners", "_type"=>"_doc", "_id"=>"10002", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [location] of type [float]", "caused_by"=>{"type"=>"json_parse_exception", "reason"=>"Current token (START_OBJECT) not numeric, can not use numeric value accessors\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@738ff5d4; line: 1, column: 47]"}}}}}

```

Running on Elastic 6.7 and logstash 6.7 any help is appreciated.

Best regards

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 3, 2019, 1:24pm UTC](https://discuss.elastic.co/t/problem-converting-latitude-and-longitude-from-jdbc-to-elastic-geo-point-using-logstash/188609/2 "2019-07-03T13:24:20Z")

</div>

Not sure if this is the problem, but field names are case sensitive. location and Location are different fields.

---

<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 31, 2019, 1:24pm UTC](https://discuss.elastic.co/t/problem-converting-latitude-and-longitude-from-jdbc-to-elastic-geo-point-using-logstash/188609/3 "2019-07-31T13:24:21Z")

</div>

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