Dar*_*ary 9 amazon-web-services elasticsearch
我们将AWS Elasticsearch用于日志.日志通过Logstash连续流式传输.定期删除旧索引的最佳方法是什么?
我搜索过,推荐的各种方法是:
使用lambda删除旧索引 - https://medium.com/@egonbraun/periodically-cleaning-elasticsearch-indexes-using-aws-lambda-f8df0ebf4d9f
使用预定的泊坞容器 - http://www.tothenew.com/blog/running-curator-in-docker-container-to-remove-old-elasticsearch-indexes/
对于像"删除15天以上的索引"这样的基本要求,这些方法似乎有些过分
实现这一目标的最佳方法是什么?AWS是否提供我可以调整的任何设置?
运行 curator 非常轻松。
在这里您可以找到 Dockerfile、配置和操作文件。
https://github.com/zakkg3/curator
此外,如果您需要(除其他外),Curator 可以帮助您:
https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html
以下是删除超过 15 天的索引的典型操作文件:
actions:
1:
action: delete_indices
description: >-
Delete indices older than 15 days (based on index name), for logstash-
prefixed indices. Ignore the error if the filter does not result in an
actionable list of indices (ignore_empty_list) and exit cleanly.
options:
ignore_empty_list: True
disable_action: True
filters:
- filtertype: pattern
kind: prefix
value: logstash-
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 15
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4176 次 |
| 最近记录: |