# Geoip: How to map any index to a template?

**URL:** <https://discuss.elastic.co/t/geoip-how-to-map-any-index-to-a-template/89612>\
**Category:** Logstash\
**Created:** [June 15, 2017, 6:56pm UTC](https://discuss.elastic.co/t/geoip-how-to-map-any-index-to-a-template/89612 "2017-06-15T18:56:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DrPhlux](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@DrPhlux](https://discuss.elastic.co/u/DrPhlux)\
**Post date:** [June 15, 2017, 6:56pm UTC](https://discuss.elastic.co/t/geoip-how-to-map-any-index-to-a-template/89612/1 "2017-06-15T18:56:08Z")

</div>

Hello.  
I'm trying to "convert" the geoip.location field from a number to a "geo\_point".  
My index from my test servers is called "test".

When I get this to work, I need to map index: "prod" to the same template.

My template look like this:  
`# curl -XGET 'localhost:9200/_template?pretty' { "logstash" : { "order" : 0, "version" : 50001, "template" : "logstash-*", "settings" : { "index" : { "refresh_interval" : "5s" } }, "mappings" : { "_default_" : { "dynamic_templates" : [{ "message_field" : { "path_match" : "message", "mapping" : { "norms" : false, "type" : "text" }, "match_mapping_type" : "string" } }, { "string_fields" : { "mapping" : { "norms" : false, "type" : "text", "fields" : { "keyword" : { "type" : "keyword" } } }, "match_mapping_type" : "string", "match" : "*" } }], "_all" : { "norms" : false, "enabled" : true }, "properties" : { "@timestamp" : { "include_in_all" : false, "type" : "date" }, "geoip" : { "dynamic" : true, "properties" : { "ip" : { "type" : "ip" }, "latitude" : { "type" : "half_float" }, "location" : { "type" : "geo_point" }, "longitude" : { "type" : "half_float" } } }, "@version" : { "include_in_all" : false, "type" : "keyword" } } } }, "aliases" : { } } }`

---

<div class="post-metadata">

**Author:** ![DrPhlux](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@DrPhlux](https://discuss.elastic.co/u/DrPhlux)\
**Post date:** [June 15, 2017, 9:04pm UTC](https://discuss.elastic.co/t/geoip-how-to-map-any-index-to-a-template/89612/2 "2017-06-15T21:04:44Z")

</div>

Fixed it by creating two new complete copies of the "logstash" template called "test" and "prod".

---

<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 13, 2017, 9:05pm UTC](https://discuss.elastic.co/t/geoip-how-to-map-any-index-to-a-template/89612/3 "2017-07-13T21:05:10Z")

</div>

Closed on July 13, 2017, 9:05pm UTC

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