elasticsearch - 如何连续从elasticsearch删除旧的流利日志?

标签 elasticsearch logging fluentd elasticsearch-curator

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/

相关文章:

iis - WC3 网站日志格式

elasticsearch - 如何调试Fluentd为什么不将数据发送到Elasticsearch?

batch-file - 批量设置=log.txt

c++ - 如何在 boost log 2.0 中设置 std::ios_base 标志,如 std::left?

fluentd - 通过fluentD限制相同日志的条数

regex - Fluentd 过滤器以排除具有空值的键

c# - 接口(interface)上带有嵌套 ElasticType 的 ElasticSearch

elasticsearch - 如何在 Elasticsearch 中为每小时访客构建数据

hadoop - 哪个搜索引擎适合大数据

mongodb - 显示某些数据时出现kibana错误