# Index Template Scripts (feature request)

**URL:** <https://discuss.elastic.co/t/index-template-scripts-feature-request/17524>\
**Category:** Elasticsearch\
**Created:** [May 15, 2014, 12:50am UTC](https://discuss.elastic.co/t/index-template-scripts-feature-request/17524 "2014-05-15T00:50:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![webish](https://avatars.discourse-cdn.com/v4/letter/w/919ad9/32.png) [@webish](https://discuss.elastic.co/u/webish)\
**Post date:** [May 15, 2014, 12:50am UTC](https://discuss.elastic.co/t/index-template-scripts-feature-request/17524/1 "2014-05-15T00:50:36Z")

</div>

Index Template Scripts would be a super powerful tool to build custom  
aliases when an index gets created.

For example: time data that uses aliases to wrap up time ranges across  
multiple indices need to be curated by an outside process. this is extra  
work and inefficient.

Ideally a script could run when a new index is added using the template.  
If the new index is a "new day" (index per day) then an alias called "last  
7 days" could be updated to add the index and remove the 8th day.

Or perhaps I'm missing a feature in Elastic Search that already lets you  
handle this scenario automatically?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/57fa4033-3373-4362-9e14-3f19db34f282%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/57fa4033-3373-4362-9e14-3f19db34f282%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:29am UTC](https://discuss.elastic.co/t/index-template-scripts-feature-request/17524/2 "2017-07-06T01:29:17Z")

</div>


