# How to create aliases in index Template for last 7 days?

**URL:** <https://discuss.elastic.co/t/how-to-create-aliases-in-index-template-for-last-7-days/76977>\
**Category:** Elasticsearch\
**Created:** [March 1, 2017, 12:21pm UTC](https://discuss.elastic.co/t/how-to-create-aliases-in-index-template-for-last-7-days/76977 "2017-03-01T12:21:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [March 1, 2017, 12:21pm UTC](https://discuss.elastic.co/t/how-to-create-aliases-in-index-template-for-last-7-days/76977/1 "2017-03-01T12:21:02Z")

</div>

Hi,

How can i able to create aliases in a index Template in such a way it will create alias for last 7 days indices.

IS there any way to do that? Because my data comes every day ln a index like  
`data-jan-2017`,

Thanks

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 5, 2017, 11:29pm UTC](https://discuss.elastic.co/t/how-to-create-aliases-in-index-template-for-last-7-days/76977/2 "2017-03-05T23:29:29Z")

</div>

You can't remove an alias from an index with a template, but you can add one.  
To remove them, look at Elasticsearch Curator - [https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html).

---

<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:** [April 2, 2017, 11:30pm UTC](https://discuss.elastic.co/t/how-to-create-aliases-in-index-template-for-last-7-days/76977/3 "2017-04-02T23:30:15Z")

</div>

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