# Setting up Rollover Index

**URL:** <https://discuss.elastic.co/t/setting-up-rollover-index/203477>\
**Category:** Elasticsearch\
**Created:** [October 14, 2019, 2:34pm UTC](https://discuss.elastic.co/t/setting-up-rollover-index/203477 "2019-10-14T14:34:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edster](https://avatars.discourse-cdn.com/v4/letter/e/da6949/32.png) [@edster](https://discuss.elastic.co/u/edster)\
**Post date:** [October 14, 2019, 2:34pm UTC](https://discuss.elastic.co/t/setting-up-rollover-index/203477/1 "2019-10-14T14:34:42Z")

</div>

Hello, we keep running into issues trying to setup rollover index. I am not sure how to go about setting up the rollover. We have already have a template added to the elastic servers.

> curl -XPUT "hostname:9200/\_template/indexalias\_template" -H 'Content-Type: application/json' -d'  
> {  
> "index\_patterns": [  
> "index\*"  
> ],  
> "order": 100000,  
> "settings": {  
> "number\_of\_shards": 2,  
> "number\_of\_replicas": 1  
> },  
> "aliases" : {  
> "indexalias" : {}  
> }  
> }'

However, we've also tried running

> curl -X POST "hostname:9200/indexalias/\_rollover?pretty" -H 'Content-Type: application/json' -d'  
> {  
> "conditions": {  
> "max\_age": "15m"  
> }  
> }'

and

> curl -X PUT indexalias-2019.10.09  
> {  
> "aliases": {  
> "indexalias":{  
> "is\_write\_index": true  
> }  
> }  
> }'

However, this is giving errors such as like the index name not being able to match the pattern. The indices were created before running the last 2 curl commands i posted. The 1st was run before I ran anything. What exactly is the proper process? We want to have, of course, the alias rollover from the old index to the new index. everyday. We set it to 15 min here but will look to have it set up for 1d (1 day).

---

<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:** [November 11, 2019, 2:34pm UTC](https://discuss.elastic.co/t/setting-up-rollover-index/203477/2 "2019-11-11T14:34:51Z")

</div>

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