# Location field from index is not mapped to location geo\_point at template

**URL:** <https://discuss.elastic.co/t/location-field-from-index-is-not-mapped-to-location-geo-point-at-template/101342>\
**Category:** Elasticsearch\
**Created:** [September 21, 2017, 1:30pm UTC](https://discuss.elastic.co/t/location-field-from-index-is-not-mapped-to-location-geo-point-at-template/101342 "2017-09-21T13:30:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![themoisis](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@themoisis](https://discuss.elastic.co/u/themoisis)\
**Post date:** [September 21, 2017, 1:30pm UTC](https://discuss.elastic.co/t/location-field-from-index-is-not-mapped-to-location-geo-point-at-template/101342/1 "2017-09-21T13:30:44Z")

</div>

Hi,

I have an index named 'nginx\_access\*' and a template named nginx\_access\*. The tamplate is modified to tell elastic search how to parse indexes geo fields. SO, my template has at some point:

```
          "dma_code" : { "type" : "short" },
          "ip" : { "type" : "ip" },
          "latitude" : { "type" : "half_float" },
          "location" : { "type" : "geo_point" },
          "longitude" : { "type" : "half_float" },

```

However, the json from my 'nginx\_access\*' index which corresponds to an nginx log has the following regarding geoip:

"geoip": {  
"city\_name": "Athens",  
"timezone": "Europe/Athens",  
"ip": "94.64.92.16",  
"latitude": 37.9833,  
"country\_name": "Greece",  
"country\_code2": "GR",  
"continent\_code": "EU",  
"country\_code3": "GR",  
"region\_name": "Attica",  
"location": {  
"lon": 23.7333,  
"lat": 37.9833  
},

Consequently, i cannot plot any coordinate map in kibana, as i'm getting "The "nginx\_access\*" index pattern does not contain any of the following field types: geo\_point "

Also, my logstash.conf regrding nginx is the following:

```
 mutate { replace => { type => "nginx_access" } }

 grok {
    match => ["message" , "%{COMBINEDAPACHELOG}+%{GREEDYDATA:extra_fields}"]
    overwrite => ["message"]
 }

 mutate {
    convert => ["response", "integer"]
    convert => ["bytes", "integer"]
    convert => ["responsetime", "float"]
 }

 geoip {
    source => "clientip"
}

```

Any help would be appreciated.Thanks

---

<div class="post-metadata">

**Author:** ![themoisis](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@themoisis](https://discuss.elastic.co/u/themoisis)\
**Post date:** [September 21, 2017, 1:49pm UTC](https://discuss.elastic.co/t/location-field-from-index-is-not-mapped-to-location-geo-point-at-template/101342/2 "2017-09-21T13:49:00Z")

</div>

OK, guys, just worked. Something was messing with the template name, that i created in elastic search or i had to delete ild index and create again the index in kibana. So, I submitted again the template from the console in dev tools from kibana.

```
 PUT _template/nginx_access
{
  "template" : "nginx_access*",
  "version" : 50001,
  "settings" : {
    "index.refresh_interval" : "5s"
  },
  "mappings" : {
    "_default_" : {
        "properties" : {
          "@timestamp" : {
            "type" : "date"
          },
          "@version" : {
            "type" : "text",
   .......
     
        "dma_code" : { "type" : "short" },
          "ip" : { "type" : "ip" },
          "latitude" : { "type" : "half_float" },
          "location" : { "type" : "geo_point" },
          "longitude" : { "type" : "half_float" },
     ........

```

Then, i deleted my old index 'nginx\_access\*' and i created a new one with the same name in kibana. New log lines are comming in elastic search now with geoip.location interpreted as a geo\_point, and as a result, I can visulize the coordinates in kibana map. Thanks.

---

<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:** [September 22, 2017, 6:46am UTC](https://discuss.elastic.co/t/location-field-from-index-is-not-mapped-to-location-geo-point-at-template/101342/3 "2017-09-22T06:46:27Z")

</div>

> [@themoisis](#):
>
> "template" : "nginx\_access\*",

That's important, cause it tells the template to match index names beginning with that name 🙂

---

<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:** [October 20, 2017, 6:46am UTC](https://discuss.elastic.co/t/location-field-from-index-is-not-mapped-to-location-geo-point-at-template/101342/4 "2017-10-20T06:46:27Z")

</div>

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