# Change Mapping for Field for ALL OF LOGSTASH Created indexes

**URL:** <https://discuss.elastic.co/t/change-mapping-for-field-for-all-of-logstash-created-indexes/45802>\
**Category:** Elasticsearch\
**Created:** [March 30, 2016, 1:54pm UTC](https://discuss.elastic.co/t/change-mapping-for-field-for-all-of-logstash-created-indexes/45802 "2016-03-30T13:54:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isra](https://avatars.discourse-cdn.com/v4/letter/i/7ba0ec/32.png) [@Isra](https://discuss.elastic.co/u/Isra)\
**Post date:** [March 30, 2016, 1:54pm UTC](https://discuss.elastic.co/t/change-mapping-for-field-for-all-of-logstash-created-indexes/45802/1 "2016-03-30T13:54:43Z")

</div>

I would like to change the type of the field `location` to `geo_point`. I'm using ES with Logstash, as y'all know, indices are generated with the name `logstash-yyyy-mm-dd`

I first created a logstash index and named it `logstash-2016-03-29`, like so:

`curl -XPUT 'http://localhost:9200/logstash-2016-03-29'`

then, I changed the mapping for supposedly all the indices called `Logstash-*` using the following:

```
curl -XPOST "http://localhost:9200/logstash-*/_mapping/logs" -d '{
"properties" : {
            "location" : { "type":"geo_point" }
        }
}'

```

And when I ran the Logstash configuration file, all the `location` fields in the index `logstash-2016-03-29` were indeed of type geo\_point.

However, today, the auto-generated index `logstash-2016-03-30` had field `location` of type `String` instead of `geo_point`. I thought the type should be applied on ANY index that starts with the name`logstash-*`. Apparently, I was wrong. How can I fix this so that any future index created by logstash that have the `location` field would have that field type set to `geo_point` instead of `String`?

Thanks.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 30, 2016, 2:06pm UTC](https://discuss.elastic.co/t/change-mapping-for-field-for-all-of-logstash-created-indexes/45802/2 "2016-03-30T14:06:54Z")

</div>

To update the mappings that new indexes get, update the index template. By default Logstash's elasticsearch output manages it for you. See that plugin's options.

---

<div class="post-metadata">

**Author:** ![Isra](https://avatars.discourse-cdn.com/v4/letter/i/7ba0ec/32.png) [@Isra](https://discuss.elastic.co/u/Isra)\
**Post date:** [March 30, 2016, 2:32pm UTC](https://discuss.elastic.co/t/change-mapping-for-field-for-all-of-logstash-created-indexes/45802/3 "2016-03-30T14:32:05Z")

</div>

I read about it, but I'm not exactly sure how it's used. Just setting it to false will stop the auto setting of templates for the rest of the newly created logstash indexes and copy the mapping of the first logstash-yyy-mm-dd to the rest of logstash-\*?

---

<div class="post-metadata">

**Author:** ![Isra](https://avatars.discourse-cdn.com/v4/letter/i/7ba0ec/32.png) [@Isra](https://discuss.elastic.co/u/Isra)\
**Post date:** [March 30, 2016, 2:57pm UTC](https://discuss.elastic.co/t/change-mapping-for-field-for-all-of-logstash-created-indexes/45802/4 "2016-03-30T14:57:28Z")

</div>

> [@Isra](#):
>
> I read about it, but I'm not exactly sure how it's used. Just setting it to false will stop the auto setting of templates for the rest of the newly created logstash indexes and copy the mapping of the first logstash-yyy-mm-dd to the rest of logstash-\*?

I read about it, but I'm not exactly sure how it's used. Just setting it to false will stop the auto setting of templates for the rest of the newly created logstash indexes and copy the mapping of the first logstash-yyy-mm-dd to the rest of logstash-\*?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 30, 2016, 4:52pm UTC](https://discuss.elastic.co/t/change-mapping-for-field-for-all-of-logstash-created-indexes/45802/5 "2016-03-30T16:52:36Z")

</div>

Disabling `manage_template` means that you'll be responsible for keeping the desired index template up to date. Another option is to keep `manage_template` enabled but point Logstash to a file where you keep your index template.

---

<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 5, 2017, 11:03pm UTC](https://discuss.elastic.co/t/change-mapping-for-field-for-all-of-logstash-created-indexes/45802/6 "2017-07-05T23:03:59Z")

</div>


