我想在不使用curator的情况下从elasticsearch中删除旧的(比如说最近10天)索引。有没有其他方法可以删除所有旧的索引?(有没有使用Node.js删除索引的方法)
注意:我已经在谷歌上搜索过了,但没有找到任何合适的答案,而且很多人都在使用curator。
发布于 2019-01-10 20:29:29
为什么不直接使用delete index API呢?https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html
为了找出哪个索引是最旧的,如果没有关于索引名称或滚动的命名约定,您只需检查每个索引中的最小和最大时间戳,然后根据该时间戳决定删除哪些索引。可以在以下位置找到从索引中获取这些时间戳的简单查询:What's the fastest manner to retrieve min timestamp from Elasticsearch indices?
https://stackoverflow.com/questions/54128560
复制相似问题