# How do I update a index template?

**URL:** <https://discuss.elastic.co/t/how-do-i-update-a-index-template/91455>\
**Category:** Elasticsearch\
**Created:** [June 30, 2017, 2:55pm UTC](https://discuss.elastic.co/t/how-do-i-update-a-index-template/91455 "2017-06-30T14:55:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xamox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xamox/32/5447_2.png) [@xamox](https://discuss.elastic.co/u/xamox)\
**Post date:** [June 30, 2017, 2:55pm UTC](https://discuss.elastic.co/t/how-do-i-update-a-index-template/91455/1 "2017-06-30T14:55:04Z")

</div>

I'm currently using a modified index template for filebeat. I have data ingesting with the indexs rolling daily based on data. The fields are coming from logstash grok. I want to parse some additional fields and want that field to be indexed. If I try to post the template via curl it says template already exists. I'm fine if old logs don't have that index but I would like the newly created indexes to use an updated template (i.e. I've added a new field called field.environment).

Do I need to just delete the existing template and add the new template and elasticsearch will pick it up when it rolls over to the next day or is there something else I need to do?

---

<div class="post-metadata">

**Author:** ![Julien](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julien/32/19688_2.png) [@Julien](https://discuss.elastic.co/u/Julien)\
**Post date:** [June 30, 2017, 6:17pm UTC](https://discuss.elastic.co/t/how-do-i-update-a-index-template/91455/2 "2017-06-30T18:17:21Z")

</div>

A put request should work to update template, note template is applied at index creation so wont affect existing indices  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html)

---

<div class="post-metadata">

**Author:** ![xamox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xamox/32/5447_2.png) [@xamox](https://discuss.elastic.co/u/xamox)\
**Post date:** [July 11, 2017, 4:59pm UTC](https://discuss.elastic.co/t/how-do-i-update-a-index-template/91455/3 "2017-07-11T16:59:31Z")

</div>

That's fine. I'm assuming it will create a new index on the next day correct, in that if I updated the template that field should be in the index on the next day?

---

<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:** [August 8, 2017, 4:59pm UTC](https://discuss.elastic.co/t/how-do-i-update-a-index-template/91455/4 "2017-08-08T16:59:34Z")

</div>

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