# How to delete rollover indices , using deprecated query

**URL:** <https://discuss.elastic.co/t/how-to-delete-rollover-indices-using-deprecated-query/104430>\
**Category:** Elasticsearch\
**Created:** [October 18, 2017, 4:38pm UTC](https://discuss.elastic.co/t/how-to-delete-rollover-indices-using-deprecated-query/104430 "2017-10-18T16:38:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kim-Kruse-Hansen](https://avatars.discourse-cdn.com/v4/letter/k/f1d935/32.png) [@Kim-Kruse-Hansen](https://discuss.elastic.co/u/Kim-Kruse-Hansen)\
**Post date:** [October 18, 2017, 4:38pm UTC](https://discuss.elastic.co/t/how-to-delete-rollover-indices-using-deprecated-query/104430/1 "2017-10-18T16:38:47Z")

</div>

Hi

Question is basically a copy of this question, but it remains unanswered,

> [@Delete old indices in a rollover index setup](https://discuss.elastic.co/t/delete-old-indices-in-a-rollover-index-setup/90899):
>
> How do I delete old indices in a rollover index setup? I was looking into this blog post [https://www.elastic.co/blog/managing-time-based-indices-efficiently#\_deleting\_old\_indices](https://www.elastic.co/blog/managing-time-based-indices-efficiently#_deleting_old_indices) but [field stats API](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-stats.html) is now deprecated, what is the alternate way to achieve it?

I am considering switching from daily indices style to rollover style. So I was reading your article about how to implement it: [And the big one said "Rollover" — Managing Elasticsearch time-based indices efficiently | Elastic Blog](https://www.elastic.co/blog/managing-time-based-indices-efficiently)

And if I follow the steps , it works like a charm.

However the cleanup of old indices poses a slight problem.

If I run a query to find indices to delete .

GET search-logs/\_field\_stats?level=indices  
{  
"fields": ["@timestamp"],  
"index\_constraints": {  
"@timestamp": {  
"max\_value": {  
"lt": "2016/07/03",  
"format": "yyyy/MM/dd"  
}  
}  
}  
}

I get this response.

#! Deprecation: [\_field\_stats] endpoint is deprecated! Use [\_field\_caps] instead or run a min/max aggregations on the desired fields.  
{  
"\_shards": {  
"total": 75,  
"successful": 75,  
"failed": 0  
},  
.....

So should I ignore the deprecation message or is there a newer supported approach to this? If so , could you please update the article , so it is correct and guides people in the right direction?

I see some support in curator for rollover, but as far as I can tell , it doesnt support cleanup of rollover indices yet?

Regards  
Kim

---

<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:** [October 18, 2017, 7:16pm UTC](https://discuss.elastic.co/t/how-to-delete-rollover-indices-using-deprecated-query/104430/2 "2017-10-18T19:16:08Z")

</div>

> [@Kim-Kruse-Hansen](#):
>
> I see some support in curator for rollover, but as far as I can tell , it doesnt support cleanup of rollover indices yet?

Yes, it does. It also has several improvements for that use case coming soon in the next release.

---

<div class="post-metadata">

**Author:** ![Kim-Kruse-Hansen](https://avatars.discourse-cdn.com/v4/letter/k/f1d935/32.png) [@Kim-Kruse-Hansen](https://discuss.elastic.co/u/Kim-Kruse-Hansen)\
**Post date:** [October 20, 2017, 10:56am UTC](https://discuss.elastic.co/t/how-to-delete-rollover-indices-using-deprecated-query/104430/3 "2017-10-20T10:56:40Z")

</div>

Thanks for answering.

I see that Curator is also using the deprecated fields\_stats feature at the moment. So I will go with that.

Regards

---

<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:** [November 1, 2017, 3:42pm UTC](https://discuss.elastic.co/t/how-to-delete-rollover-indices-using-deprecated-query/104430/4 "2017-11-01T15:42:38Z")

</div>

While it is true that Elasticsearch has deprecated `field_stats` in versions 5.6, and removed it in 6.0, Curator v6 (unreleased at time of posting) will continue to support its own `field_stats` feature by replacing it with a simple query. It will not be as performant, perhaps, as using the `field_stats` API was, as it requires iterating over every index individually, but it will achieve the exact same result.

---

<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 29, 2017, 3:42pm UTC](https://discuss.elastic.co/t/how-to-delete-rollover-indices-using-deprecated-query/104430/5 "2017-11-29T15:42:50Z")

</div>

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