# Data retention

**URL:** <https://discuss.elastic.co/t/data-retention/347129>\
**Category:** Elasticsearch\
**Created:** [November 14, 2023, 2:22pm UTC](https://discuss.elastic.co/t/data-retention/347129 "2023-11-14T14:22:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![admin365](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@admin365](https://discuss.elastic.co/u/admin365)\
**Post date:** [November 14, 2023, 2:22pm UTC](https://discuss.elastic.co/t/data-retention/347129/1 "2023-11-14T14:22:49Z")

</div>

Hello!

I've successfully configured a Debian-based Elasticsearch cluster with three nodes. Everything is functioning well. Currently, I need guidance on activating a data retention period of three months. Can you provide instructions on configuring data retention?

Many thanks in advance

---

<div class="post-metadata">

**Author:** ![Samuele\_Lolli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuele_lolli/32/107848_2.png) [@Samuele\_Lolli](https://discuss.elastic.co/u/Samuele_Lolli)\
**Post date:** [November 14, 2023, 2:49pm UTC](https://discuss.elastic.co/t/data-retention/347129/2 "2023-11-14T14:49:19Z")

</div>

Hi @admin365,  
to configure data retention you should use ILM (Index Lifecycle Managment).  
Here the [guide](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-lifecycle-management.html).

Tell me if you need more help

---

<div class="post-metadata">

**Author:** ![admin365](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@admin365](https://discuss.elastic.co/u/admin365)\
**Post date:** [November 14, 2023, 3:20pm UTC](https://discuss.elastic.co/t/data-retention/347129/3 "2023-11-14T15:20:59Z")

</div>

Hello,

I require guidance on configuring retention, specifically for data nodes. In my cluster, there are only two data nodes, and one dedicated to master voting only. Additionally, Kibana is installed on the same machine as the voting-only node. I'm unsure if there are specific configurations that should be applied exclusively to the two Debian nodes. What are your thoughts on this?

---

<div class="post-metadata">

**Author:** ![admin365](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@admin365](https://discuss.elastic.co/u/admin365)\
**Post date:** [November 15, 2023, 10:49am UTC](https://discuss.elastic.co/t/data-retention/347129/4 "2023-11-15T10:49:40Z")

</div>

Hello!

I tried to configure the policy and the index template but it doesn't work.  
can someone assist on how to activate data retention

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 15, 2023, 10:54am UTC](https://discuss.elastic.co/t/data-retention/347129/5 "2023-11-15T10:54:15Z")

</div>

Are you using data streams or some other type of time-based indices?

> [@admin365](#):
>
> I tried to configure the policy and the index template but it doesn't work.  
> can someone assist on how to activate data retention

Please show what your indices look like and what you have tried. It also usually helps to tell us which version of Elasticsearch you are using.

---

<div class="post-metadata">

**Author:** ![admin365](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@admin365](https://discuss.elastic.co/u/admin365)\
**Post date:** [November 15, 2023, 11:18am UTC](https://discuss.elastic.co/t/data-retention/347129/6 "2023-11-15T11:18:53Z")

</div>

Hello ! i have tried to do the following:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/0/d0e2e28ed67c237b18a97fa5e643ca47827c1f16.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/1/41b92203dad09692690d20f6e0fe28f174db5897.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/c/6c4b2bde6a9571603a499608a75d1eadbaf1047b.png)

i am using the latest version of elasticsearch.

Many thanks in advance

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 15, 2023, 11:40am UTC](https://discuss.elastic.co/t/data-retention/347129/7 "2023-11-15T11:40:43Z")

</div>

You did not provide any information about the data or the indices you have in the system.

How do you know you have a problem here if the 3 month retention limit has not been reached yet by any indices?

---

<div class="post-metadata">

**Author:** ![admin365](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@admin365](https://discuss.elastic.co/u/admin365)\
**Post date:** [November 15, 2023, 1:15pm UTC](https://discuss.elastic.co/t/data-retention/347129/8 "2023-11-15T13:15:15Z")

</div>

The problem is when i try to run the script , i receive the curl 52 error

---

<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 13, 2023, 1:15pm UTC](https://discuss.elastic.co/t/data-retention/347129/9 "2023-12-13T13:15:45Z")

</div>

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