# ILM uses the default policy

**URL:** https://discuss.elastic.co/t/ilm-uses-the-default-policy/241319
**Category:** Elasticsearch
**Tags:** ilm-index-lifecycle-management
**Created:** [July 15, 2020, 3:02pm UTC](https://discuss.elastic.co/t/ilm-uses-the-default-policy/241319 "2020-07-15T15:02:00Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Abdelhalim](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@Abdelhalim](https://discuss.elastic.co/u/Abdelhalim)
#### Post date: [July 15, 2020, 3:02pm UTC](https://discuss.elastic.co/t/ilm-uses-the-default-policy/241319/1 "2020-07-15T15:02:00Z")

</div>

Hello everyone,  
I need your help please,  
I created a new ILM policy but packetbeat is still using the default policy  
here is my configuration

**Creation of the new policy:**

PUT \_ilm/policy/hot-warm-cold-delete-60days-policy  
{  
"policy": {  
"phases": {  
"hot": {  
"actions": {  
"rollover": {  
"max\_size":"50gb",  
"max\_age":"30d"  
},  
"set\_priority": {  
"priority": 50  
}  
}  
},  
"warm": {  
"min\_age": "7d",  
"actions": {  
"forcemerge": {  
"max\_num\_segments": 1  
},  
"shrink": {  
"number\_of\_shards": 1  
},  
"allocate": {  
"require": {  
"data": "warm"  
}  
},  
"set\_priority": {  
"priority": 25  
}  
}  
},  
"cold": {  
"min\_age": "30d",  
"actions": {  
"set\_priority": {  
"priority": 0  
},  
"freeze": {},  
"allocate": {  
"require": {  
"data": "cold"  
}  
}  
}  
},  
"delete": {  
"min\_age": "60d",  
"actions": {  
"delete": {}  
}  
}  
}  
}  
}  
\*\*Creation of the new template \*\*

PUT \_template/hot-warm-cold-delete-60days-template  
{  
"index\_patterns": ["packetbeat-\*"],  
"settings": {  
"number\_of\_shards": 1,  
"number\_of\_replicas": 1,  
"index.lifecycle.name": "hot-warm-cold-delete-60days-policy",  
"index.lifecycle.rollover\_alias": "packetbeat"  
}  
}

\*\*Boostrap index \*\*

PUT packetbeat-000001  
{  
"aliases": {  
"packetbeat": {  
"is\_write\_index": true  
}  
}  
}

**check the ILM health**

{  
"indices" : {  
"packetbeat-7.8.0-2020.07.15-000001" : {  
"index" : "packetbeat-7.8.0-2020.07.15-000001",  
"managed" : true,  
"policy" : "packetbeat",  
"lifecycle\_date\_millis" : 1594822825660,  
"age" : "36.63m",  
"phase" : "hot",  
"phase\_time\_millis" : 1594822825737,  
"action" : "rollover",  
"action\_time\_millis" : 1594823388344,  
"step" : "check-rollover-ready",  
"step\_time\_millis" : 1594823388344,  
"phase\_execution" : {  
"policy" : "packetbeat",  
"phase\_definition" : {  
"min\_age" : "0ms",  
"actions" : {  
"rollover" : {  
"max\_size" : "50gb",  
"max\_age" : "30d"  
}  
}  
},  
"version" : 1,  
"modified\_date\_in\_millis" : 1594822718394  
}  
},  
"packetbeat-000001" : {  
"index" : "packetbeat-000001",  
"managed" : true,  
"policy" : "hot-warm-cold-delete-60days-policy",  
"lifecycle\_date\_millis" : 1594822682756,  
"age" : "39.01m",  
"phase" : "hot",  
"phase\_time\_millis" : 1594822682803,  
"action" : "rollover",  
"action\_time\_millis" : 1594822788404,  
"step" : "check-rollover-ready",  
"step\_time\_millis" : 1594822788404,  
"phase\_execution" : {  
"policy" : "hot-warm-cold-delete-60days-policy",  
"phase\_definition" : {  
"min\_age" : "0ms",  
"actions" : {  
"rollover" : {  
"max\_size" : "50gb",  
"max\_age" : "30d"  
},  
"set\_priority" : {  
"priority" : 50  
}  
}  
},  
"version" : 1,  
"modified\_date\_in\_millis" : 1594822612162  
}  
}  
}  
}

\*\*In kibana I delete the default policy, but I always find it back and packetbeat still using it and not use my new policy \*\*

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/f/5fa4dace3c51f6dca228bcffebeb9e645821ff55.png)

**packetbeat configuration**  
output.elasticsearch:  
setup.ilm.enabled: true  
setup.ilm.policy\_name: "hot-warm-cold-delete-60days-policy"

---

<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: [August 12, 2020, 3:02pm UTC](https://discuss.elastic.co/t/ilm-uses-the-default-policy/241319/2 "2020-08-12T15:02:03Z")

</div>

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