# 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:** 7\
**Page:** 1

<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:** [January 31, 2022, 10:45pm UTC](https://discuss.elastic.co/t/rollover-ilm-policy-for-existing-index/295885/1 "2022-01-31T22:45:56Z")

</div>

Hi Can anyone help me on Rollover ILM for existing index , which needs to be rolled over on reaching certain age/ gb. Thankyou in advance.

---

<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:** [February 1, 2022, 12:02am UTC](https://discuss.elastic.co/t/rollover-ilm-policy-for-existing-index/295885/2 "2022-02-01T00:02:48Z")

</div>

Welcome to our community! 😃

Have you seen [Manage existing indices | Elasticsearch Guide [7.16] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-with-existing-indices.html)? Have you tried anything in it if you have? If so what config did you use? What's not working how you expect?

---

<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, 1:55am UTC](https://discuss.elastic.co/t/rollover-ilm-policy-for-existing-index/295885/3 "2022-02-01T01:55:12Z")

</div>

Yes tried with alias.. but getting the error. Alias index not pointing to the index, Getting the new index created .. but not pulling the logs.. and the existing index is growing on which I’m supposed to apply the rollover policy

---

<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:** [February 1, 2022, 1:58am UTC](https://discuss.elastic.co/t/rollover-ilm-policy-for-existing-index/295885/4 "2022-02-01T01:58:47Z")

</div>

It'd be useful if you shared the policy you created as well as other commands and errors you run/see when you are applying it.

---

<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)

---

<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, 6:39pm UTC](https://discuss.elastic.co/t/rollover-ilm-policy-for-existing-index/295885/6 "2022-02-01T18:39:59Z")

</div>

Can we apply rollover ilm policy to the existing index which is already huge like 90gb.. what could be the best approach please.

---

<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:** [March 1, 2022, 6:40pm UTC](https://discuss.elastic.co/t/rollover-ilm-policy-for-existing-index/295885/7 "2022-03-01T18:40:26Z")

</div>

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