# Automatically closing indices older than x days using ILP

**URL:** <https://discuss.elastic.co/t/automatically-closing-indices-older-than-x-days-using-ilp/325765>\
**Category:** Kibana\
**Tags:** ilm-index-lifecycle-management, slm-snapshot-lifecycle-management\
**Created:** [February 16, 2023, 5:24pm UTC](https://discuss.elastic.co/t/automatically-closing-indices-older-than-x-days-using-ilp/325765 "2023-02-16T17:24:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Monica\_majua](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/monica_majua/32/116099_2.png) [@Monica\_majua](https://discuss.elastic.co/u/Monica_majua)\
**Post date:** [February 16, 2023, 5:24pm UTC](https://discuss.elastic.co/t/automatically-closing-indices-older-than-x-days-using-ilp/325765/1 "2023-02-16T17:24:02Z")

</div>

I was wondering if it is possible to configure a lifecycle policy so that nodes older than 300 days are automatically closing? I would like to know if I am on the right way or am I really trying something that I will never achieve  
I was trying something like:

```auto
PUT _ilm/policy/my_police
{
  "policy": {
    "phases": {
...
      "cold": {
        "min_age": "60d",
        "actions": {
          "close": {}
        }
      },
...

```

Thanks!

---

<div class="post-metadata">

**Author:** ![Wave](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wave/32/117242_2.png) [@Wave](https://discuss.elastic.co/u/Wave)\
**Post date:** [February 16, 2023, 8:21pm UTC](https://discuss.elastic.co/t/automatically-closing-indices-older-than-x-days-using-ilp/325765/2 "2023-02-16T20:21:17Z")

</div>

Hi @Monica_majua,  
Yes, you can close indices that are 300 days or older. Are you able to use the Kibana interface to configure this? You can do it through the API, but will probably find it easier through the UI. Here are the docs for an [overview](https://www.elastic.co/guide/en/elasticsearch/reference/8.6/index-lifecycle-management.html) and [API](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete.html).

---

<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 16, 2023, 8:21pm UTC](https://discuss.elastic.co/t/automatically-closing-indices-older-than-x-days-using-ilp/325765/3 "2023-03-16T20:21:54Z")

</div>

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