# Index alias

**URL:** <https://discuss.elastic.co/t/index-alias/297921>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [February 22, 2022, 3:28pm UTC](https://discuss.elastic.co/t/index-alias/297921 "2022-02-22T15:28:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eran\_Hadad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eran_hadad/32/102407_2.png) [@Eran\_Hadad](https://discuss.elastic.co/u/Eran_Hadad)\
**Post date:** [February 22, 2022, 3:28pm UTC](https://discuss.elastic.co/t/index-alias/297921/1 "2022-02-22T15:28:06Z")

</div>

Hi all,  
I am a beginner in elastic and I've inherited an environment in elastic cloud.  
I have an index that ends with a dash, let's call it `indexname-`  
Developers wrote code to insert records to this index name.  
There is no index template and no lifecycle management.  
Now I want to perform some order in the mess that is currently happening.  
I want to create an ILM and also to change the index name to something more normal like `indexname-000001`

Now here comes my question, forget about the index rename for now, assuming data is not important and I create a new index with a proper name as mentioned above.  
I guess I need to create an index template with an alias named `indexname`  
Then ask for the developers to change the reference in their code to `indexname` instead of `indexname-`, will this cause the code to write to my index `indexname-00001`?

Also after creating the ILM it will automatically create a new index named `indexname-000002` and point the alias to this index?

Thanks in advance for your patience to a novice.

---

<div class="post-metadata">

**Author:** ![DineshNaik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dineshnaik/32/89308_2.png) [@DineshNaik](https://discuss.elastic.co/u/DineshNaik)\
**Post date:** [February 22, 2022, 7:42pm UTC](https://discuss.elastic.co/t/index-alias/297921/2 "2022-02-22T19:42:17Z")

</div>

Yes , your understanding is correct. The rollover strategy would depend upon the ism policy you define.

---

<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:** [February 22, 2022, 10:53pm UTC](https://discuss.elastic.co/t/index-alias/297921/3 "2022-02-22T22:53:52Z")

</div>

Welcome to our community! 😃

> [@Eran\_Hadad](#):
>
> Then ask for the developers to change the reference in their code to `indexname` instead of `indexname-`

You could also use an alias so there's no code changes needed.

---

<div class="post-metadata">

**Author:** ![Eran\_Hadad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eran_hadad/32/102407_2.png) [@Eran\_Hadad](https://discuss.elastic.co/u/Eran_Hadad)\
**Post date:** [February 23, 2022, 8:27am UTC](https://discuss.elastic.co/t/index-alias/297921/4 "2022-02-23T08:27:00Z")

</div>

Great guys,  
Thanks for your help

---

<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:** [March 23, 2022, 8:27am UTC](https://discuss.elastic.co/t/index-alias/297921/5 "2022-03-23T08:27:39Z")

</div>

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