# Geoip.location field latitude/longitude coordinates are reversed

**URL:** <https://discuss.elastic.co/t/geoip-location-field-latitude-longitude-coordinates-are-reversed/48715>\
**Category:** Logstash\
**Created:** [April 28, 2016, 5:23pm UTC](https://discuss.elastic.co/t/geoip-location-field-latitude-longitude-coordinates-are-reversed/48715 "2016-04-28T17:23:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Groten](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@Ryan\_Groten](https://discuss.elastic.co/u/Ryan_Groten)\
**Post date:** [April 28, 2016, 5:23pm UTC](https://discuss.elastic.co/t/geoip-location-field-latitude-longitude-coordinates-are-reversed/48715/1 "2016-04-28T17:23:29Z")

</div>

my logstash.conf:

```
    geoip {
            source => "client_ip"
            target => "geoip"
    }
    mutate {
            add_field => ["mylocation", "%{[geoip][location]}" ]
    }

```

In the error below notice that geoip.latitude and geoip.longitude values are populated properly...but the geoip.location field values are reversed. As a result the coordinates are wrong and many of the entries throw the following error when added:

```
"geoip"=>{
    "ip"=>"xx.xx.xx.xx", 
    "latitude"=>53.6867, 
    "longitude"=>-113.7102
    "location"=>[-113.7102, 53.6867]
}

response=>{
    "create"=>{
        "status"=>400, "error"=>{
            "type"=>"mapper_parsing_exception", 
            "reason"=>"failed to parse", 
            "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"illegal latitude value [-113.7102] for mylocation"}
         }
    }
}
```

---

<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 6, 2017, 5:00am UTC](https://discuss.elastic.co/t/geoip-location-field-latitude-longitude-coordinates-are-reversed/48715/2 "2017-07-06T05:00:08Z")

</div>


