# Deleting the 30 day olderdata from the elastic search

**URL:** https://discuss.elastic.co/t/deleting-the-30-day-olderdata-from-the-elastic-search/135398
**Category:** Elasticsearch
**Created:** [June 11, 2018, 3:20pm UTC](https://discuss.elastic.co/t/deleting-the-30-day-olderdata-from-the-elastic-search/135398 "2018-06-11T15:20:18Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![sandeepnarla22322](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@sandeepnarla22322](https://discuss.elastic.co/u/sandeepnarla22322)
#### Post date: [June 11, 2018, 3:20pm UTC](https://discuss.elastic.co/t/deleting-the-30-day-olderdata-from-the-elastic-search/135398/1 "2018-06-11T15:20:18Z")

</div>

Hello all,

Thanks in advance

I want to delete the logs which are older 3 days from my elastic search index

I have read about curator and have few doubts pertaining to it. I was wondering what exactly rollover option does in curator and what configuration changes needs to be done in elasticsearch.yml to make this option work.

Do I have to create a new index with this option or can I use the existing indices to accommodate my need

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [June 11, 2018, 4:42pm UTC](https://discuss.elastic.co/t/deleting-the-30-day-olderdata-from-the-elastic-search/135398/2 "2018-06-11T16:42:10Z")

</div>

> [@sandeepnarla22322](#):
>
> I was wondering what exactly rollover option does in curator

It simply executes the [Rollover API](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/indices-rollover-index.html).

> [@sandeepnarla22322](#):
>
> what configuration changes needs to be done in elasticsearch.yml to make this option work.

Nothing needs to be changed in `elasticsearch.yml`. It's only a series of normal API calls. Please refer to the [Rollover API documentation](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/indices-rollover-index.html) to see how to create your initial index & alias.

---

<div class="post-metadata">

### Author: ![sandeepnarla22322](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@sandeepnarla22322](https://discuss.elastic.co/u/sandeepnarla22322)
#### Post date: [June 11, 2018, 4:55pm UTC](https://discuss.elastic.co/t/deleting-the-30-day-olderdata-from-the-elastic-search/135398/3 "2018-06-11T16:55:02Z")

</div>

if i have created an initial index using the logstash.conf will that impact the proceeding

I do have a index already created using the logstash.conf which i want use it, is that possible

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [June 12, 2018, 10:58am UTC](https://discuss.elastic.co/t/deleting-the-30-day-olderdata-from-the-elastic-search/135398/4 "2018-06-12T10:58:05Z")

</div>

That will depend on the index name, and whether you can point an alias at it.

---

<div class="post-metadata">

### Author: ![sandeepnarla22322](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@sandeepnarla22322](https://discuss.elastic.co/u/sandeepnarla22322)
#### Post date: [June 12, 2018, 2:15pm UTC](https://discuss.elastic.co/t/deleting-the-30-day-olderdata-from-the-elastic-search/135398/5 "2018-06-12T14:15:44Z")

</div>

I have my indices created per day basis my intent is to store 30 days of logs at any give point of time

example:06/12/2018-07/11/2018

on 07/12 i want to delete 06/12

can i use curator to achieve this

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [June 12, 2018, 2:18pm UTC](https://discuss.elastic.co/t/deleting-the-30-day-olderdata-from-the-elastic-search/135398/6 "2018-06-12T14:18:03Z")

</div>

> [@sandeepnarla22322](#):
>
> can i use curator to achieve this

Yes. But if you're doing daily indices, you don't need Rollover. You can just use the regular `age` filter to catch indices older than a set number of days.

---

<div class="post-metadata">

### Author: ![sandeepnarla22322](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@sandeepnarla22322](https://discuss.elastic.co/u/sandeepnarla22322)
#### Post date: [June 18, 2018, 3:27pm UTC](https://discuss.elastic.co/t/deleting-the-30-day-olderdata-from-the-elastic-search/135398/7 "2018-06-18T15:27:51Z")

</div>

Hey @theuntergeek

If I don't want to use the curator is there way to delete time based indices  
i have indices created per day and want to delete indices which are older than 30 days  
Will there be any performance impact

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [June 18, 2018, 4:03pm UTC](https://discuss.elastic.co/t/deleting-the-30-day-olderdata-from-the-elastic-search/135398/8 "2018-06-18T16:03:29Z")

</div>

> [@sandeepnarla22322](#):
>
> If I don't want to use the curator is there way to delete time based indices

Sure. Write your own script that makes the API calls you want.

> [@sandeepnarla22322](#):
>
> i have indices created per day and want to delete indices which are older than 30 days  
> Will there be any performance impact

There would be a performance impact for _keeping_ indices for a longer period of time, but generally not an impact for deleting them.

---

<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: [July 16, 2018, 4:03pm UTC](https://discuss.elastic.co/t/deleting-the-30-day-olderdata-from-the-elastic-search/135398/9 "2018-07-16T16:03:43Z")

</div>

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