# ILM not deleting indices in data\_stream

**URL:** <https://discuss.elastic.co/t/ilm-not-deleting-indices-in-data-stream/257811>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [December 7, 2020, 7:42am UTC](https://discuss.elastic.co/t/ilm-not-deleting-indices-in-data-stream/257811 "2020-12-07T07:42:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zerobot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zerobot/32/48977_2.png) [@Zerobot](https://discuss.elastic.co/u/Zerobot)\
**Post date:** [December 7, 2020, 7:42am UTC](https://discuss.elastic.co/t/ilm-not-deleting-indices-in-data-stream/257811/1 "2020-12-07T07:42:19Z")

</div>

Hello!  
So I've been checking out new features of ELK stack - created a template for data stream and connected a basic ILM policy to it.  
ILM policy is basically:

```auto
 {
   "policy": {
     "phases": {
       "hot": {
         "min_age": "0ms",
         "actions": {
           "forcemerge": {
             "max_num_segments": 1,
             "index_codec": "best_compression"
           },
           "rollover": {
             "max_size": "5gb",
             "max_age": "30d"
           },
           "set_priority": {
             "priority": 100
           }
         }
       },
       "delete": {
         "min_age": "1d",
         "actions": {}
       }
     }
   }
 }

```

Problem I encountered is that even tho ILM says the deletion phase was a success I still can see all those indices in Data Stream being totally active and .. totally open. It seems ILM didn't delete them even though API says it did:

```auto
 {
  "indices" : {
     ".ds-xxxxxxxxxx-000001" : {
       "index" : ".ds-xxxxxxxxx-000001",
       "managed" : true,
       "policy" : "poc_policy",
       "lifecycle_date_millis" : 1606834534205,
       "age" : "5.69d",
       "phase" : "delete",
       "phase_time_millis" : 1606921534194,
       "action" : "complete",
       "action_time_millis" : 1606835134195,
       "step" : "complete",
       "step_time_millis" : 1606921534194,
       "phase_execution" : {
         "policy" : "poc_policy",
          "phase_definition" : {
           "min_age" : "1d",
           "actions" : { }
         },
         "version" : 3,
         "modified_date_in_millis" : 1606816056890
       }
     }
   }
 }

```

Is this a known bug or did I do something wrong ?

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [December 7, 2020, 5:50pm UTC](https://discuss.elastic.co/t/ilm-not-deleting-indices-in-data-stream/257811/2 "2020-12-07T17:50:44Z")

</div>

Hi Zerobot,

Your policy is close! It's missing the actual delete action though:

```auto
"delete": {
  "min_age": "1d",
  "actions": {}
}

```

Should look like:

```auto
"delete": {
  "min_age": "1d",
  "actions": {
    "delete": {}
  }
}

```

Hope that helps!

---

<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:** [January 4, 2021, 5:50pm UTC](https://discuss.elastic.co/t/ilm-not-deleting-indices-in-data-stream/257811/3 "2021-01-04T17:50:48Z")

</div>

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