从elasticsearch中删除旧的logstash索引
logstash-index-cleaner的Python项目详细描述
此项目已弃用!使用elasticsearch管理员:https://github.com/elasticsearch/curator
从ElasticSearch中删除早于n天的日志存储索引。
$ logstash-index-cleaner -h usage: logstash-index-cleaner [-h] [-v] [--host HOST] [--port PORT] [-t TIMEOUT] [-p PREFIX] [-s SEPARATOR] [-H HOURS_TO_KEEP] [-d DAYS_TO_KEEP] [-n] Delete old logstash indices from Elasticsearch. optional arguments: -h, --help show this help message and exit -v, --version show program's version number and exit --host HOST Elasticsearch host. --port PORT Elasticsearch port -t TIMEOUT, --timeout TIMEOUT Elasticsearch timeout -p PREFIX, --prefix PREFIX Prefix for the indices. Indices that do not have this prefix are skipped. -s SEPARATOR, --separator SEPARATOR Time unit separator -H HOURS_TO_KEEP, --hours-to-keep HOURS_TO_KEEP Number of hours to keep. -d DAYS_TO_KEEP, --days-to-keep DAYS_TO_KEEP Number of days to keep. -n, --dry-run If true, does not perform any changes to the Elasticsearch indices.
项目历史
这是https://github.com/crashdump/logstash-elasticsearch-scripts的叉子。
由于ElasticSearch 0.90所有字段都被压缩,一些基准测试表明 没有什么可以改进优化那些已经压缩的索引。这就是为什么这个叉子 不包括原始的logstash_index_optimize.py
优化参考: