您的位置:首页 > 其它

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

2014-10-31 12:11 211 查看
如果使用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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: