简体   繁体   中英

How to delete all old indices without elasticsearch-curator?

I want to delete the old(let say last 10 days) indices from elasticsearch without using curator. Is there any other way to delete all old indices?. (Is there a way to delete indices using Node.js)

Note: I have googled about it but did not find any proper answers and also many are using curator.

Why not just use the delete index API directly? https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html

In order to find which index is the oldest, in case there is no naming convention around the indices names or rollover, you can just check what is the min & max timestamp in each index, and then decide based on that which indices to delete. a simple query to get these timestamp from an index can be found here: What's the fastest manner to retrieve min timestamp from Elasticsearch indices?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM