# Rollover ILM policy for existing Index

**URL:** <https://discuss.elastic.co/t/rollover-ilm-policy-for-existing-index/295885>\
**Category:** Logstash\
**Tags:** ilm-index-lifecycle-management\
**Created:** [January 31, 2022, 10:45pm UTC](https://discuss.elastic.co/t/rollover-ilm-policy-for-existing-index/295885 "2022-01-31T22:45:56Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Vani1](https://avatars.discourse-cdn.com/v4/letter/v/f07891/32.png) [@Vani1](https://discuss.elastic.co/u/Vani1)\
**Post date:** [February 1, 2022, 3:19am UTC](https://discuss.elastic.co/t/rollover-ilm-policy-for-existing-index/295885/5 "2022-02-01T03:19:31Z")

</div>

```
PUT _ilm/policy/logstash_30days

```

{  
"policy": {  
"phases": {  
"hot": {  
"min\_age" : "0ms",  
"actions": {  
"rollover": {  
"max\_size":"50gb",  
"max\_age":"30d"  
},  
"set\_priority": {  
"priority": 100  
}  
}  
},  
"warm": {

```
    "actions": {
      
      
      "shrink": {
        "number_of_shards": 1
      },
                
      "set_priority": {
        "priority": 50
      }
    }
  },
  "cold": {
    "min_age": "0d",
    "actions": {
     "freeze": {},
     "set_priority": {
        "priority": 0
      }

    }
  },
  "delete": {
    "min_age": "45d",
    "actions": {
      "delete": {
       "delete_searchable_snapshot" : true 

```

}  
}  
}  
}  
}  
}

* * *

Template:

PUT \_template/template\_1  
{  
"index\_pattern": ["logstash\*"],  
"settings":{  
"number\_of\_shards" :1  
"number\_of\_replicas" :1  
"name:"logstash\_30days"  
"rollover\_alias" : "logstash\_rollover\_alias"  
}  
}

* * *

PUT logstash-000001  
{  
"aliases":{  
"logstash\_rollover\_alias":{  
"is\_write\_index":true  
}  
}  
}

Error:  
[https://discuss.elastic.co/t/index-lifecycle-rollover-alias-does-not-point-to-index](https://discuss.elastic.co/t/index-lifecycle-rollover-alias-does-not-point-to-index)

---

_[View the full topic](https://discuss.elastic.co/t/rollover-ilm-policy-for-existing-index/295885)._
