# Specific retention duration for logs (Index Lifecycle Policy)

**URL:** https://discuss.elastic.co/t/specific-retention-duration-for-logs-index-lifecycle-policy/288635
**Category:** Beats
**Tags:** winlogbeat
**Created:** [November 8, 2021, 2:22pm UTC](https://discuss.elastic.co/t/specific-retention-duration-for-logs-index-lifecycle-policy/288635 "2021-11-08T14:22:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Sco](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@Sco](https://discuss.elastic.co/u/Sco)
#### Post date: [November 8, 2021, 2:22pm UTC](https://discuss.elastic.co/t/specific-retention-duration-for-logs-index-lifecycle-policy/288635/1 "2021-11-08T14:22:24Z")

</div>

Hi guys,

I would need some help with Index Lifecycle Policies, and it's setup.

I need to set up winlogbeat to store data for X days and delete it afterward. Simple as that.  
Tried different configurations in ILM but I can't force it to delete.

The policy now is just a Hot phase, and after 80 days delete:

```auto
PUT _ilm/policy/winlogbeat
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "set_priority": {
            "priority": 100
          }
        }
      },
      "delete": {
        "min_age": "80d",
        "actions": {
          "delete": {
            "delete_searchable_snapshot": true
          }
        }
      }
    }
  }
}

```

Tried Hot, Warm, Delete having them on separate Instances but that didn't do the trick either.

Is there a command that I need to run to reapply the adjusted policy on indices? If so what command and where to run it?

Thanks a lot in advance!

---

<div class="post-metadata">

### Author: ![mtojek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mtojek/32/63863_2.png) [@mtojek](https://discuss.elastic.co/u/mtojek)
#### Post date: [November 9, 2021, 9:48am UTC](https://discuss.elastic.co/t/specific-retention-duration-for-logs-index-lifecycle-policy/288635/2 "2021-11-09T09:48:27Z")

</div>

Did you follow this guide: [Implementing Hot-Warm-Cold in Elasticsearch with Index Lifecycle Management | Elastic Blog](https://www.elastic.co/blog/implementing-hot-warm-cold-in-elasticsearch-with-index-lifecycle-management) ?

---

<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: [December 7, 2021, 11:48am UTC](https://discuss.elastic.co/t/specific-retention-duration-for-logs-index-lifecycle-policy/288635/3 "2021-12-07T11:48:35Z")

</div>

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