# ES6.8 vs monitoring retention

**URL:** <https://discuss.elastic.co/t/es6-8-vs-monitoring-retention/298283>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring\
**Created:** [February 25, 2022, 1:13pm UTC](https://discuss.elastic.co/t/es6-8-vs-monitoring-retention/298283 "2022-02-25T13:13:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefws](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefws/32/6442_2.png) [@stefws](https://discuss.elastic.co/u/stefws)\
**Post date:** [February 25, 2022, 1:13pm UTC](https://discuss.elastic.co/t/es6-8-vs-monitoring-retention/298283/1 "2022-02-25T13:13:42Z")

</div>

Reading [Logging indices retention](https://www.elastic.co/guide/en/cloud/current/ec-enable-logging-and-monitoring.html#ec-logging-and-monitoring-log-retention) it seems that ES6.8 might no adhere to xpack.monitoring.history.duration default value of 168h ~7days.

And without any default ilm policy I created my own:

```auto
{
  "delete_after_7days" : {
    "version" : 1,
    "modified_date" : "2022-02-25T10:47:59.852Z",
    "policy" : {
      "phases" : {
        "hot" : {
          "min_age" : "0ms",
          "actions" : {
            "set_priority" : {
              "priority" : 90
            }
          }
        },
        "delete" : {
          "min_age" : "7d",
          "actions" : {
            "delete" : { }
          }
        }
      }
    }
  }
}

```

I extracted current mapping of eg. .monitoring-es and added the lifecycle.name to it's setting and PUTed it back, but can't GET this back with this lifeycle settings, why not?

TIA!

Added lifecycle.name settings:

 ![Screenshot 2022-02-25 at 14.08.42](https://us1.discourse-cdn.com/elastic/original/3X/6/7/67686ed60fa5e22fb796e088f2cbbcde65b721e4.png)

re-retrieving the template settings is still not there?

 ![Screenshot 2022-02-25 at 14.09.29](https://us1.discourse-cdn.com/elastic/original/3X/d/2/d23fe72bff62a7c1f9f9f9b687d2c93d5f909cd6.png)

---

<div class="post-metadata">

**Author:** ![stefws](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefws/32/6442_2.png) [@stefws](https://discuss.elastic.co/u/stefws)\
**Post date:** [February 25, 2022, 1:17pm UTC](https://discuss.elastic.co/t/es6-8-vs-monitoring-retention/298283/2 "2022-02-25T13:17:37Z")

</div>

🙂 just tried this format instead which seems to work

 ![Screenshot 2022-02-25 at 14.21.29](https://us1.discourse-cdn.com/elastic/original/3X/5/d/5d56966870c29b197269b67b58726c0474e27739.png)

---

<div class="post-metadata">

**Author:** ![stefws](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefws/32/6442_2.png) [@stefws](https://discuss.elastic.co/u/stefws)\
**Post date:** [February 27, 2022, 12:15pm UTC](https://discuss.elastic.co/t/es6-8-vs-monitoring-retention/298283/3 "2022-02-27T12:15:22Z")

</div>

Weirdly it seems to disappear from templates again, appreiciate any hints as to why this might happen...

Applied previous the ilm policy delete\_after\_7days to .monitoring-es template as in line 253 but fetching template again in line 252 seen on the right now again shows no ilm policy, where did that goes in the last two days.

 ![Screenshot 2022-02-27 at 13.07.06](https://us1.discourse-cdn.com/elastic/original/3X/e/8/e829bb3150ea29cdf03a294ae1c82eeaf2011a79.png)

---

<div class="post-metadata">

**Author:** ![stefws](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefws/32/6442_2.png) [@stefws](https://discuss.elastic.co/u/stefws)\
**Post date:** [March 4, 2022, 7:02pm UTC](https://discuss.elastic.co/t/es6-8-vs-monitoring-retention/298283/4 "2022-03-04T19:02:40Z")

</div>

weirdly if I choose to set the ILM policy in the templates through Kibana: Management-\>Index LifeCycle Policy-\>Actions-\>Add policy to index template

If I GET the template afterwards it looks the same as expected:

```auto
...
"settings" : {
  "index" : {
     ...
     "lifecycle" : {
         "name" : "my-policy"
      }
  }
}
...

```

But more importantly now it seems to stay here also next day 🙂

Wondering though what's the difference in setting it 'manually' into the templates or through the Kibana UI's Actions-\>Add policy to index template?

---

<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:** [April 1, 2022, 7:03pm UTC](https://discuss.elastic.co/t/es6-8-vs-monitoring-retention/298283/5 "2022-04-01T19:03:28Z")

</div>

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