# Alias not applying on Index which gets created daily

**URL:** <https://discuss.elastic.co/t/alias-not-applying-on-index-which-gets-created-daily/97528>\
**Category:** Elasticsearch\
**Created:** [August 18, 2017, 8:13am UTC](https://discuss.elastic.co/t/alias-not-applying-on-index-which-gets-created-daily/97528 "2017-08-18T08:13:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yasho](https://avatars.discourse-cdn.com/v4/letter/y/c2a13f/32.png) [@Yasho](https://discuss.elastic.co/u/Yasho)\
**Post date:** [August 18, 2017, 8:13am UTC](https://discuss.elastic.co/t/alias-not-applying-on-index-which-gets-created-daily/97528/1 "2017-08-18T08:13:45Z")

</div>

I am trying not to create alias manually for my indexes which get created every day, by mentioning alias in my template

{  
"xxx\_test": {  
"order": 0,  
"template": "xxx\_test\*",  
"settings": {  
"index": {  
"number\_of\_shards": "5",  
"number\_of\_replicas": "0"  
}  
},  
"mappings": {  
"xxx\_test": {  
"dynamic": "true",  
"dynamic\_templates": [  
{  
"index\_name": {  
"mapping": {  
"index": "not\_analyzed"  
},  
"match\_mapping\_type": "_",  
"match": "_"  
}  
}  
],  
"properties": {  
"@timestamp": {  
"format": "strict\_date\_optional\_time||epoch\_millis",  
"type": "date"  
},  
"Value": {  
"type": "double"  
},  
"Timestamp": {  
"format": "strict\_date\_optional\_time||epoch\_millis||date\_hour\_minute\_second\_millis||yyyy-MM-dd HH:mm:ss,SSS",  
"type": "date"  
}  
}  
}  
},  
"aliases": {  
xxx\_test: {}  
}  
}

This gives error as one alias cannot represent multiple indices.

How to dynamically create alias for the index which gets created per day.  
Eg

Index day 1 - abc\_20170811  
Index day2 - abc\_20170812  
Index day3 - abc\_20170813

I want the Index alias to be "abc".

---

<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:** [September 15, 2017, 8:13am UTC](https://discuss.elastic.co/t/alias-not-applying-on-index-which-gets-created-daily/97528/2 "2017-09-15T08:13:54Z")

</div>

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