# Limit data retention on the hosted product?

**URL:** <https://discuss.elastic.co/t/limit-data-retention-on-the-hosted-product/214606>\
**Category:** APM\
**Tags:** server\
**Created:** [January 10, 2020, 2:31pm UTC](https://discuss.elastic.co/t/limit-data-retention-on-the-hosted-product/214606 "2020-01-10T14:31:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsumners\_knock](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsumners_knock/32/60630_2.png) [@jsumners\_knock](https://discuss.elastic.co/u/jsumners_knock)\
**Post date:** [January 10, 2020, 2:31pm UTC](https://discuss.elastic.co/t/limit-data-retention-on-the-hosted-product/214606/1 "2020-01-10T14:31:02Z")

</div>

How can I limit the data retention on our hosted plan? Is there an easy way to limit to, for example, 30 days of data?

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [January 10, 2020, 2:57pm UTC](https://discuss.elastic.co/t/limit-data-retention-on-the-hosted-product/214606/2 "2020-01-10T14:57:02Z")

</div>

Hi @jsumners_knock,  
depending on the version you are running you have following options:

From `7.5` on you can [configure ILM policies](https://www.elastic.co/guide/en/apm/server/current/ilm.html) directly in the APM Server configuration, allowing you to add a `delete` phase for indices. If you restart APM Server with new config values, ensure to set `apm-server.ilm.setup.overwrite: true` so the new policies are overwriting existing ones. Such policy changes are going to be applied when indices enter the next phase.  
For `7.x` versions \< `7.5` see the [manual ILM setup guide](https://www.elastic.co/guide/en/apm/server/7.4/manual-ilm-setup.html).

Alternatively you can update ILM policies via [Kibana UI](https://www.elastic.co/guide/en/kibana/7.5/index-lifecycle-policies.html).

You might also be interested in the general guide on [how to reduce storage](https://www.elastic.co/guide/en/apm/server/current/reduce-storage.html).

---

<div class="post-metadata">

**Author:** ![jsumners\_knock](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsumners_knock/32/60630_2.png) [@jsumners\_knock](https://discuss.elastic.co/u/jsumners_knock)\
**Post date:** [January 10, 2020, 3:52pm UTC](https://discuss.elastic.co/t/limit-data-retention-on-the-hosted-product/214606/3 "2020-01-10T15:52:47Z")

</div>

I'm not an ES administrator and have no desire to become one. I'd really prefer a simple UI that does all of this (one of the reasons to use the hosted product IMHO).

After performing an upgrade so that I can _try_ to follow your instructions, I have come to:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/4/249e6cb65d3b8d99f53cc13e79b25da3a299d224.png)

It looks like the upgrade has included the exact policy I'm looking for on at least most of the new indices. Do I need to do anything for the one labeled "`apm-7.5.1*`"? Is it going to grow ad infinitum as it has done previously? Or is it limited by the ones that have the "apm-rollover-30-days" policy?

What can I do to clean up the old `apm-7.3.2` stuff? Do I need it any longer? Has that data been migrated into the 7.5.1 data?

---

<div class="post-metadata">

**Author:** ![jsumners\_knock](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsumners_knock/32/60630_2.png) [@jsumners\_knock](https://discuss.elastic.co/u/jsumners_knock)\
**Post date:** [January 13, 2020, 7:56pm UTC](https://discuss.elastic.co/t/limit-data-retention-on-the-hosted-product/214606/4 "2020-01-13T19:56:38Z")

</div>

@simitt do you have any more information for these questions?

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [January 14, 2020, 8:20am UTC](https://discuss.elastic.co/t/limit-data-retention-on-the-hosted-product/214606/5 "2020-01-14T08:20:14Z")

</div>

The screenshot you posted shows the created templates and index patterns. For checking that ILM policies are actually applied to your indices please check the `Indices` tab. You should see indices for all event types in the form of `apm-7.5.1-error-000001`. You can click on _Lifecycle status_ and choose _Managed_, which filters for all indices managed with ILM - if the `7.5.1` indices show up there ILM is applied as expected. You can also click on an index and see which lifecycle policy is applied.

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [January 14, 2020, 8:33am UTC](https://discuss.elastic.co/t/limit-data-retention-on-the-hosted-product/214606/6 "2020-01-14T08:33:10Z")

</div>

Regarding your question whether or not indices grow infinitly: the default policy in 7.5 rolls over after 30 days or when reaching a size of 50gb, whichever limit is reached first. This means that a new index is created at those limits. The default policy does not contain a `delete` phase though. So if you want to remove data, you need to add a delete phase. Please refer to my previous answer where I linked to according documentation.

---

<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:** [February 4, 2020, 4:33am UTC](https://discuss.elastic.co/t/limit-data-retention-on-the-hosted-product/214606/7 "2020-02-04T04:33:21Z")

</div>

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