elasticsearch时间格式索引管理工具: curator

来源:互联网 发布:手机上的c语言编辑器 编辑:程序博客网 时间:2024/06/09 22:50

如果使用elasticsearch时,你是使用时间作为索引,那么可以通过curator对索引进行管理。通过curator可以大大简化索引的管理成本。

github: https://github.com/elasticsearch/curator

缺省的选项:

--host localhost--port 9200-t (or --timeout) 30-T (or --time-unit) days-p (or --prefix) logstash-

curator匹配索引的方式是:prefix + 时间字符串格式 + suffix

其中时间字符串格式可以通过使用python strftime formatting构造。

使用方法:

 1. 删除30天前的索引

curator delete --older-than 30
2. 关闭14天前的所有索引

curator close --older-than 14
3. 列出所有索引
curator show --show-indices

0 0
原创粉丝点击