# Elasticsearch \> logstash \> Elasticsearch failing - illegal latitude value

**URL:** <https://discuss.elastic.co/t/elasticsearch-logstash-elasticsearch-failing-illegal-latitude-value/83432>\
**Category:** Logstash\
**Created:** [April 24, 2017, 3:40pm UTC](https://discuss.elastic.co/t/elasticsearch-logstash-elasticsearch-failing-illegal-latitude-value/83432 "2017-04-24T15:40:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeremyinNC](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremyinnc/32/44868_2.png) [@JeremyinNC](https://discuss.elastic.co/u/JeremyinNC)\
**Post date:** [April 24, 2017, 3:40pm UTC](https://discuss.elastic.co/t/elasticsearch-logstash-elasticsearch-failing-illegal-latitude-value/83432/1 "2017-04-24T15:40:53Z")

</div>

Dumping from an ES 1.7.6 server to 2.4.4 with the logstash elasticsearch input I see the following message for the majority of my documents:

```
"status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"illegal latitude value [-98.92457739999999] for pin.location"}}}},

```

I've tried truncating these values using the following but still get the same message:

```
truncate {
    length_bytes => 4
    fields => "[pin][location][lat]"
        }

```

I've tried truncating pin.location as well but that seems to have no effect.

I don't mind losing some accuracy if I can get these events in but I'm at a loss how to get them in there.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 25, 2017, 7:37am UTC](https://discuss.elastic.co/t/elasticsearch-logstash-elasticsearch-failing-illegal-latitude-value/83432/2 "2017-04-25T07:37:46Z")

</div>

You've probably mixed up the order of longitude and latitude. Latitudes are always in the [-90, 90] range but longitudes are in [-180, 180].

---

<div class="post-metadata">

**Author:** ![JeremyinNC](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremyinnc/32/44868_2.png) [@JeremyinNC](https://discuss.elastic.co/u/JeremyinNC)\
**Post date:** [May 4, 2017, 1:48pm UTC](https://discuss.elastic.co/t/elasticsearch-logstash-elasticsearch-failing-illegal-latitude-value/83432/3 "2017-05-04T13:48:26Z")

</div>

Yes, that was it. Somehow the service that's passing it had them swapped.

---

<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:** [June 1, 2017, 2:00pm UTC](https://discuss.elastic.co/t/elasticsearch-logstash-elasticsearch-failing-illegal-latitude-value/83432/4 "2017-06-01T14:00:16Z")

</div>

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