# Rollover index is not working as expected after applied the policy to index

**URL:** <https://discuss.elastic.co/t/rollover-index-is-not-working-as-expected-after-applied-the-policy-to-index/199604>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [September 16, 2019, 8:21am UTC](https://discuss.elastic.co/t/rollover-index-is-not-working-as-expected-after-applied-the-policy-to-index/199604 "2019-09-16T08:21:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![krish2](https://avatars.discourse-cdn.com/v4/letter/k/b5a626/32.png) [@krish2](https://discuss.elastic.co/u/krish2)\
**Post date:** [September 16, 2019, 8:21am UTC](https://discuss.elastic.co/t/rollover-index-is-not-working-as-expected-after-applied-the-policy-to-index/199604/1 "2019-09-16T08:21:46Z")

</div>

Hi ,

I have created a new ILM policy for rollover index , but when I run the below command I'm getting the below error , and the policy is also not applied to the existing index.

Kibana Devtools console:

GET filebeat-7.1.1/\_ilm/explain

Output:

{  
"indices" : {  
"filebeat-7.1.1" : {  
"index" : "filebeat-7.1.1",  
"managed" : true,  
"policy" : "new\_policy",  
"lifecycle\_date\_millis" : 1566224013121,  
"phase" : "hot",  
"phase\_time\_millis" : 1568028813045,  
"action" : "rollover",  
"action\_time\_millis" : 1568029141484,  
"step" : "ERROR",  
"step\_time\_millis" : 1568116741177,  
"failed\_step" : "check-rollover-ready",  
"step\_info" : {  
"type" : "illegal\_argument\_exception",  
"reason" : "index name [filebeat-7.1.1] does not match pattern '^._-\d+'", "stack\_trace" : """ java.lang.IllegalArgumentException: index name [filebeat-7.1.1] does not match pattern '^._-\d+'  
at org.elasticsearch.action.admin.indices.rollover.TransportRolloverAction.generateRolloverIndexName(TransportRolloverAction.java:236)  
at org.elasticsearch.action.admin.indices.rollover.TransportRolloverAction.masterOperation(TransportRolloverAction.java:119)  
at org.elasticsearch.action.admin.indices.rollover.TransportRolloverAction.masterOperation(TransportRolloverAction.java:66)  
at org.elasticsearch.action.support.master.TransportMasterNodeAction.masterOperation(TransportMasterNodeAction.java:127)  
at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction$2.doRun(TransportMasterNodeAction.java:208)  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)  
at org.elasticsearch.common.util.concurrent.EsExecutors$DirectExecutorService.execute(EsExecutors.java:192)  
at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction.doStart(TransportMasterNodeAction.java:205)  
at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction.start(TransportMasterNodeAction.java:161)  
at org.elasticsearch.action.support.master.TransportMasterNodeAction.doExecute(TransportMasterNodeAction.java:138)  
at org.elasticsearch.action.support.master.TransportMasterNodeAction.doExecute(TransportMasterNodeAction.java:58)  
at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:145)  
at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.apply(SecurityActionFilter.java:123)  
at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:143)  
at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:121)  
at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:64)  
at org.elasticsearch.client.node.NodeClient.executeLocally(NodeClient.java:83)  
at org.elasticsearch.client.node.NodeClient.doExecute(NodeClient.java:72)  
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:393)  
at org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin(ClientHelper.java:88)  
at org.elasticsearch.xpack.core.ClientHelper.executeWithHeadersAsync(ClientHelper.java:151)  
at org.elasticsearch.xpack.indexlifecycle.LifecyclePolicySecurityClient.doExecute(LifecyclePolicySecurityClient.java:51)  
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:393)  
at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.execute(AbstractClient.java:1213)  
at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.rolloverIndex(AbstractClient.java:1715)  
at org.elasticsearch.xpack.core.indexlifecycle.WaitForRolloverReadyStep.evaluateCondition(WaitForRolloverReadyStep.java:115)  
at org.elasticsearch.xpack.indexlifecycle.IndexLifecycleRunner.runPeriodicStep(IndexLifecycleRunner.java:133)  
at org.elasticsearch.xpack.indexlifecycle.IndexLifecycleService.triggerPolicies(IndexLifecycleService.java:270)  
at org.elasticsearch.xpack.indexlifecycle.IndexLifecycleService.triggered(IndexLifecycleService.java:213)  
at org.elasticsearch.xpack.core.scheduler.SchedulerEngine.notifyListeners(SchedulerEngine.java:168)  
at org.elasticsearch.xpack.core.scheduler.SchedulerEngine$ActiveSchedule.run(SchedulerEngine.java:196)  
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)  
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)  
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)  
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)  
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)  
at java.base/java.lang.Thread.run(Thread.java:835)

"""  
},  
"phase\_execution" : {  
"policy" : "new\_policy",  
"phase\_definition" : {  
"min\_age" : "0ms",  
"actions" : {  
"rollover" : {  
"max\_age" : "1d"  
}  
}  
},  
"version" : 1,  
"modified\_date\_in\_millis" : 1568028696032  
}  
}  
}  
}

for policy creation and apply it to index I ran the below commands:

Setting up an ILM policy :

PUT \_ilm/policy/new\_policy  
{  
"policy": {  
"phases": {  
"hot": {  
"actions": {  
"rollover": {  
"max\_age": "1d"  
}  
}  
}  
}  
}  
}

POST /\_aliases  
{  
"actions" : [  
{ "add" : { "index" : "filebeat-7.1.1", "alias" : "filebeat-alias" } }  
]  
}

PUT /%3Cfilebeat-%7Bnow%2Fs%7Byyyy-MM-dd-HH-mm-ss%7D%7D-1%3E  
{  
"aliases": {  
"filebeat-alias":{  
"is\_write\_index": true  
}  
}  
}

PUT \_template/filebeat-7.1.1  
{  
"index\_patterns": ["filebeat-\*"],  
"settings": {  
"number\_of\_shards": 1,  
"number\_of\_replicas": 0,  
"index.lifecycle.name": "new\_policy",  
"index.lifecycle.rollover\_alias": "filebeat-alias"  
}  
}

POST /filebeat-alias/\_rollover  
{  
"conditions": {  
"max\_age": "1d",  
"max\_size": "1gb"  
}  
}

new index is not creating based on policy and not rollover , kindly help me on this.

---

<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:** [October 14, 2019, 8:21am UTC](https://discuss.elastic.co/t/rollover-index-is-not-working-as-expected-after-applied-the-policy-to-index/199604/2 "2019-10-14T08:21:54Z")

</div>

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