# Is there any way to create aliases for new (Future) index also in elasticsearch?

**URL:** <https://discuss.elastic.co/t/is-there-any-way-to-create-aliases-for-new-future-index-also-in-elasticsearch/39569>\
**Category:** Elasticsearch\
**Created:** [January 19, 2016, 4:54pm UTC](https://discuss.elastic.co/t/is-there-any-way-to-create-aliases-for-new-future-index-also-in-elasticsearch/39569 "2016-01-19T16:54:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thiruna](https://avatars.discourse-cdn.com/v4/letter/t/6bbea6/32.png) [@thiruna](https://discuss.elastic.co/u/thiruna)\
**Post date:** [January 19, 2016, 4:54pm UTC](https://discuss.elastic.co/t/is-there-any-way-to-create-aliases-for-new-future-index-also-in-elasticsearch/39569/1 "2016-01-19T16:54:52Z")

</div>

Hello,

We can able to create aliases and filters for the existing indexes without any issues.

However we are not able to create aliases for the new indexes.

Is there any way to create aliases for new (Future) index also in elasticsearch?

Thanks,  
Thiru.

---

<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:** [January 19, 2016, 9:18pm UTC](https://discuss.elastic.co/t/is-there-any-way-to-create-aliases-for-new-future-index-also-in-elasticsearch/39569/2 "2016-01-19T21:18:10Z")

</div>

You cannot add an index that doesn't exist to an alias.

You can setup a template that contains an alias though, that would work.

---

<div class="post-metadata">

**Author:** ![thiruna](https://avatars.discourse-cdn.com/v4/letter/t/6bbea6/32.png) [@thiruna](https://discuss.elastic.co/u/thiruna)\
**Post date:** [January 21, 2016, 9:31pm UTC](https://discuss.elastic.co/t/is-there-any-way-to-create-aliases-for-new-future-index-also-in-elasticsearch/39569/3 "2016-01-21T21:31:31Z")

</div>

Hi Warkolm,

I have created the template with alias and it's working fine and alias created.

However, when trying alias filter with the template getting below error  
"failed action with response of 400, dropping action:"

Anything wrong with this template?

Template :  
curl -XPUT '[http://localhost:9200/\_template/template\_cpu](http://localhost:9200/_template/template_cpu)' -d ' {  
"template":"logstash-tools-alias-test-\*", "order": 1,"settings":{"index.number\_of\_replicas":"1"},  
"aliases" : { "alias-system-cpu" : {"filter" : { "term" : {"host.raw" : "[xxx.xxx](http://xxx.xxx)" } }, "routing" : "[xxx.xxx](http://xxx.xxx)"} }}'

Thanks,  
Thiru.

---

<div class="post-metadata">

**Author:** ![thiruna](https://avatars.discourse-cdn.com/v4/letter/t/6bbea6/32.png) [@thiruna](https://discuss.elastic.co/u/thiruna)\
**Post date:** [January 26, 2016, 8:47pm UTC](https://discuss.elastic.co/t/is-there-any-way-to-create-aliases-for-new-future-index-also-in-elasticsearch/39569/4 "2016-01-26T20:47:54Z")

</div>

Hello Warkolm,

Did you get a chance to very this Template query which will have alias with filter in it?

Template :  
curl -XPUT '[http://localhost:9200/\_template/template\_cpu](http://localhost:9200/_template/template_cpu)' -d ' {  
"template":"logstash-tools-alias-test-\*", "order": 1,"settings":{"index.number\_of\_replicas":"1"},  
"aliases" : { "alias-system-cpu" : {"filter" : { "term" : {"host.raw" : "[xxx.xxx](http://xxx.xxx)" } }, "routing" : "[xxx.xxx](http://xxx.xxx)"} }}'

is there anything wrong on this template?

Thanks,  
Thiru.

---

<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:21pm UTC](https://discuss.elastic.co/t/is-there-any-way-to-create-aliases-for-new-future-index-also-in-elasticsearch/39569/5 "2017-07-05T23:21:16Z")

</div>


