Fluentd日志收集器写入Elasticsearch,最终填充磁盘。例如,如何将它们限制为一个月?
Fluentd配置的一部分(使用Kubernetes):
<match kubernetes.**>
@type elasticsearch_dynamic
host elasticsearch.default.svc.cluster.local
port 9200
include_tag_key true
logstash_format true
logstash_prefix kubernetes-${record['kubernetes']['pod_name']}
</match>
Elasticsearch的“Curator”可以删除“索引”,但是我不知道Fluentd创建什么索引,何时停止使用索引,以及当其中仍然有有用的新日志时删除索引意味着什么?
最佳答案
无论Logstash,流利的软件或其他任何应用程序,馆长都会为您删除索引。本示例将与您在上面的注释中提供的索引模式一起使用。
---
actions:
1:
action: delete_indices
description: >-
Delete indices older than 30 days (based on index name), for kubernetes-elasticsearch-
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: kubernetes-elasticsearch-
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 30
关于elasticsearch - 如何连续从elasticsearch删除旧的流利日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47650375/