# ES is rejecting my geo\_point object

**URL:** https://discuss.elastic.co/t/es-is-rejecting-my-geo-point-object/170435
**Category:** Elasticsearch
**Created:** [March 1, 2019, 5:15am UTC](https://discuss.elastic.co/t/es-is-rejecting-my-geo-point-object/170435 "2019-03-01T05:15:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Stuart\_O\_Reilly](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Stuart\_O\_Reilly](https://discuss.elastic.co/u/Stuart_O_Reilly)
#### Post date: [March 1, 2019, 5:15am UTC](https://discuss.elastic.co/t/es-is-rejecting-my-geo-point-object/170435/1 "2019-03-01T05:15:14Z")

</div>

Hello,  
I am having some trouble understanding why my geo\_point object is being rejected by ES.  
I am using serilog (with the elasticsearch sink) to feed data into elasticsearch and kibana to display the results.

If i have a new ES index, and i set the following template (this is the only change from default that i do)

```
PUT _template/template_geopointtest
{
  "index_patterns": [
    "logstash*"
  ],
  "mappings": {
    "logevent": {
      "properties": {
        "fields": {
          "properties": {
            "location": {
              "type": "geo_point"
            }
          }
        }
      }
    }
  }
}  

```

To send the geo\_point to ES, I use this line  
_Log.Information("{name}{@location}{@value}{property}", name, 2000, "Temperature");_

Because the above line has the @ symbol in front of the word "location", the location object will be deconstructed into a JSON object and sent to ES in that format.  
e.g. like this (sorry about the formatting, the editor doesn't seem to be recognizing it as formatted text)  
{  
"\_index": "logstash-2019.03.01",  
"\_type": "logevent",  
"\_id": "eOOLN2kBosvpV7qDsM5l",  
"\_version": 1,  
"\_score": null,  
"\_source": {  
"@timestamp": "2019-03-01T15:38:16.4592112+11:00",  
"level": "Information",  
"messageTemplate": "{name}{@location}{@value}{property}",  
"message": ""MyDesk"Location { lat: 34.7797508239746, lon: 32.927131652832 } 594"Temperature"",  
"fields": {  
"modulename": "MyDesk",  
"location": {  
"\_typeTag": "Location",  
"lat": 34.77975082397461,  
"lon": 32.92713165283203  
},  
"value": 594,  
"property": "Temperature"  
}  
},  
"fields": {  
"@timestamp": [  
"2019-03-01T04:38:16.459Z"  
]  
},  
"sort": [  
1551415096459  
]  
}

BUT i get the following error

Failed to store event with template '{name}{@location}{@value}{property}' into Elasticsearch. Elasticsearch reports for index logstash-2019.03.01 the following: {"type":"mapper\_parsing\_exception","reason":"failed to parse","caused\_by":{"type":"parse\_exception","reason":"field must be either [lat], [lon] or [geohash]"}}

Am i getting this error because of the "\_typeTag" element that exists in the location object?  
If so, any i dea on how i may remove the element from the sending side or modify the receiving side to accept the object?  
Thanks for your help  
Cheers  
Stuart

---

<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 1, 2019, 5:25am UTC](https://discuss.elastic.co/t/es-is-rejecting-my-geo-point-object/170435/2 "2019-03-01T05:25:26Z")

</div>

> [@Stuart\_O\_Reilly](#):
>
> "\_typeTag": "Location",

That's probably the problem, can you remove it?

---

<div class="post-metadata">

### Author: ![Stuart\_O\_Reilly](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Stuart\_O\_Reilly](https://discuss.elastic.co/u/Stuart_O_Reilly)
#### Post date: [March 1, 2019, 5:49am UTC](https://discuss.elastic.co/t/es-is-rejecting-my-geo-point-object/170435/3 "2019-03-01T05:49:20Z")

</div>

Thanks for answering. I have (just now) found a way to remove that tag and elasticsearch now picks up my location correctly  
🙂

---

<div class="post-metadata">

### Author: ![Stuart\_O\_Reilly](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Stuart\_O\_Reilly](https://discuss.elastic.co/u/Stuart_O_Reilly)
#### Post date: [March 1, 2019, 5:51am UTC](https://discuss.elastic.co/t/es-is-rejecting-my-geo-point-object/170435/4 "2019-03-01T05:51:18Z")

</div>

Oh, and the way i removed that element was in the initialisation of serilog, i put in this line  
`.Destructure.ByTransforming<Location>(r => new{ lat=r.lat,lon=r.lon})`

which basically says, when serilog pulls apart the location object, only include the lat and lon elements in the resulting json

---

<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: [March 29, 2019, 5:51am UTC](https://discuss.elastic.co/t/es-is-rejecting-my-geo-point-object/170435/5 "2019-03-29T05:51:18Z")

</div>

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