# How to see how long we can retain the indexes in Curator?

**URL:** <https://discuss.elastic.co/t/how-to-see-how-long-we-can-retain-the-indexes-in-curator/215523>\
**Category:** Elasticsearch\
**Created:** [January 17, 2020, 8:48pm UTC](https://discuss.elastic.co/t/how-to-see-how-long-we-can-retain-the-indexes-in-curator/215523 "2020-01-17T20:48:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehak\_Bhargava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehak_bhargava/32/54750_2.png) [@Mehak\_Bhargava](https://discuss.elastic.co/u/Mehak_Bhargava)\
**Post date:** [January 17, 2020, 8:48pm UTC](https://discuss.elastic.co/t/how-to-see-how-long-we-can-retain-the-indexes-in-curator/215523/1 "2020-01-17T20:48:30Z")

</div>

How can we see how long indexes can be retained for? Can we make a scheduled task for it? How can we maintain an index by looking into freeing up disk space in intervals?

```auto
1:
action: delete_indices
    description: >-
      Delete indices older than 60 days (based on index name), for metricbeat-
      prefixed indices. Ignore the error if the filter does not result in an
      actionable list of indices (ignore_empty_list) and exit cleanly.
    options:
      ignore_empty_list: True
      timeout_override:
      continue_if_exception: False
      disable_action: False
    filters:
    - filtertype: pattern
      kind: prefix
      value: metricbeat-
      exclude:
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 28
      exclude:

```

Here unit\_count is 28 which means that it will be the number of days worth of data that we would like to retain. can it be more than 28 days?

And if not in curator, how long can we retain data in indexes before it starts affecting performance?

At 215kb, my index stopped taking logs.

---

<div class="post-metadata">

**Author:** ![mikewillis](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@mikewillis](https://discuss.elastic.co/u/mikewillis)\
**Post date:** [January 20, 2020, 1:45pm UTC](https://discuss.elastic.co/t/how-to-see-how-long-we-can-retain-the-indexes-in-curator/215523/2 "2020-01-20T13:45:10Z")

</div>

> How can we see how long indexes can be retained for?

Look at how much disk space your indices for a certain time period use, say one day or one week, then look at how much disk space your cluster has. Whether your cluster has enough RAM to keep all the indices open is a different matter which may only become evident in time.

> Can we make a scheduled task for it?

Yes. The cluster I work with is on Linux and we curator is called from a cron job once a day.

> Here unit\_count is 28 which means that it will be the number of days worth of data that we would like to retain. can it be more than 28 days?

In what you posted `unit_count` value of 28 doesn't match description which says "older than 60 days". You can set it to any number of days you want. Just make sure the cluster has enough resources to handle that.

> And if not in curator, how long can we retain data in indexes before it starts affecting performance?

I don't understand the "and if not in curator" part but how long you can keep data for before it affects performance depends on how much data you have and the resources your cluster has.

---

<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 17, 2020, 1:45pm UTC](https://discuss.elastic.co/t/how-to-see-how-long-we-can-retain-the-indexes-in-curator/215523/3 "2020-02-17T13:45:17Z")

</div>

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