# How to delete index before 5 days without curator

**URL:** https://discuss.elastic.co/t/how-to-delete-index-before-5-days-without-curator/152473
**Category:** Elasticsearch
**Created:** [October 15, 2018, 10:44am UTC](https://discuss.elastic.co/t/how-to-delete-index-before-5-days-without-curator/152473 "2018-10-15T10:44:38Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![muthu\_kumar1](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@muthu\_kumar1](https://discuss.elastic.co/u/muthu_kumar1)
#### Post date: [October 15, 2018, 10:44am UTC](https://discuss.elastic.co/t/how-to-delete-index-before-5-days-without-curator/152473/1 "2018-10-15T10:44:39Z")

</div>

How to delete index before 5 days without curator

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [October 15, 2018, 11:23am UTC](https://discuss.elastic.co/t/how-to-delete-index-before-5-days-without-curator/152473/2 "2018-10-15T11:23:47Z")

</div>

you could specify the indices using [index date math](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/date-math-index-names.html), but you still need to ensure that you sent this request at certain times.

Note, that there will be a feature named `Index Lifecycle Management` coming up in one of the next releases, that will help you with this requirement.

---

<div class="post-metadata">

### Author: ![muthu\_kumar1](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@muthu\_kumar1](https://discuss.elastic.co/u/muthu_kumar1)
#### Post date: [October 15, 2018, 11:55am UTC](https://discuss.elastic.co/t/how-to-delete-index-before-5-days-without-curator/152473/3 "2018-10-15T11:55:16Z")

</div>

still i am not getting ..My index name is beat-index how to delete this index before 2 days..can u pls help me curl for the same

---

<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: [October 15, 2018, 12:02pm UTC](https://discuss.elastic.co/t/how-to-delete-index-before-5-days-without-curator/152473/4 "2018-10-15T12:02:46Z")

</div>

I am a bit confused. What is the index lifecycle you are looking for? Can you describe the expected behaviour? Exactly when do you want to delete it? Are you using time-based indices?

---

<div class="post-metadata">

### Author: ![muthu\_kumar1](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@muthu\_kumar1](https://discuss.elastic.co/u/muthu_kumar1)
#### Post date: [October 16, 2018, 4:09am UTC](https://discuss.elastic.co/t/how-to-delete-index-before-5-days-without-curator/152473/5 "2018-10-16T04:09:36Z")

</div>

> [@Christian\_Dahlqvist](#):
>
> sing time-based indices?

yes I am using time based indices..and I need index lifecyle for 2 days..beyond 2 days it should get removed ..

---

<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: [October 16, 2018, 5:44am UTC](https://discuss.elastic.co/t/how-to-delete-index-before-5-days-without-curator/152473/6 "2018-10-16T05:44:44Z")

</div>

Then you will need a process or cron job that periodically determines the name of the index to be deleted and calls the API to perform the delete, just as Alexander described. This is what Curator does.

---

<div class="post-metadata">

### Author: ![muthu\_kumar1](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@muthu\_kumar1](https://discuss.elastic.co/u/muthu_kumar1)
#### Post date: [October 16, 2018, 7:36am UTC](https://discuss.elastic.co/t/how-to-delete-index-before-5-days-without-curator/152473/7 "2018-10-16T07:36:08Z")

</div>

yes i understood..can i get command for delete not for periodically..may be i ll execute through Dev tools in kibana ..to delete 2 days old indices..??

---

<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: [October 16, 2018, 7:37am UTC](https://discuss.elastic.co/t/how-to-delete-index-before-5-days-without-curator/152473/8 "2018-10-16T07:37:08Z")

</div>

Use the [delete index API](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/indices-delete-index.html).

---

<div class="post-metadata">

### Author: ![muthu\_kumar1](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@muthu\_kumar1](https://discuss.elastic.co/u/muthu_kumar1)
#### Post date: [October 16, 2018, 8:47am UTC](https://discuss.elastic.co/t/how-to-delete-index-before-5-days-without-curator/152473/9 "2018-10-16T08:47:52Z")

</div>

Delete index will delete the full index. Am i right?

But i need to use the same delete index to delete indices before 2 days.

---

<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: [October 16, 2018, 8:50am UTC](https://discuss.elastic.co/t/how-to-delete-index-before-5-days-without-curator/152473/10 "2018-10-16T08:50:08Z")

</div>

It will delete the index you specify it should delete. When using time-based indices the general principle is that complete indices are deleted as this is far more efficient than deleting documents from within an index using the delete by query API.

---

<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: [November 13, 2018, 8:50am UTC](https://discuss.elastic.co/t/how-to-delete-index-before-5-days-without-curator/152473/11 "2018-11-13T08:50:10Z")

</div>

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