# How to add mapping to existing index for GeoIP?

**URL:** <https://discuss.elastic.co/t/how-to-add-mapping-to-existing-index-for-geoip/145167>\
**Category:** Elasticsearch\
**Created:** [August 20, 2018, 12:55pm UTC](https://discuss.elastic.co/t/how-to-add-mapping-to-existing-index-for-geoip/145167 "2018-08-20T12:55:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mprzygrodzki](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mprzygrodzki/32/34738_2.png) [@mprzygrodzki](https://discuss.elastic.co/u/mprzygrodzki)\
**Post date:** [August 20, 2018, 12:55pm UTC](https://discuss.elastic.co/t/how-to-add-mapping-to-existing-index-for-geoip/145167/1 "2018-08-20T12:55:26Z")

</div>

Hello everyone, i'm new to ES and after reading multiple topics i'm still facing an issue with adding missing mapping to existing index. The main thing is that i'm missing geoip fields in Elasticsearch. I've found some existing templates with them but unfortunatelly they're using some depraceted fields. So, i've edited these file to be compatible with ES 6.3.1, but i'm not sure if that' ok so you can take a look on it here.

My index name is logstash-\*, i've already some indices from last days, lets say they're named as logstash-2018.08.17 etc. I'm out of idea how to add mappings to an exsisting indices to get it working ? I would be gracefull if someone can direct me how to do it.

> {  
> "index\_patterns" : "logstash-_",  
> "version" : 60001,  
> "settings" : {  
> "index.refresh\_interval" : "5s"  
> },  
> "mappings" : {  
> "\_doc" : {  
> "dynamic\_templates" : [ {  
> "message\_field" : {  
> "path\_match" : "message",  
> "match\_mapping\_type" : "string",  
> "mapping" : {  
> "type" : "text",  
> "norms" : false  
> }  
> }  
> }, {  
> "string\_fields" : {  
> "match" : "_",  
> "match\_mapping\_type" : "string",  
> "mapping" : {  
> "type" : "text", "norms" : false,  
> "fields" : {  
> "keyword" : { "type": "keyword", "ignore\_above": 256 }  
> }  
> }  
> }  
> } ],  
> "properties" : {  
> "@timestamp": { "type": "date"},  
> "@version": { "type": "keyword"},  
> "geoip" : {  
> "dynamic": true,  
> "properties" : {  
> "ip": { "type": "ip" },  
> "location" : { "type" : "geo\_point" },  
> "latitude" : { "type" : "half\_float" },  
> "longitude" : { "type" : "half\_float" }  
> }  
> }  
> }  
> }  
> }  
> }

---

<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:** [September 17, 2018, 12:55pm UTC](https://discuss.elastic.co/t/how-to-add-mapping-to-existing-index-for-geoip/145167/2 "2018-09-17T12:55:29Z")

</div>

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