【问题标题】:Elasticsearch curator delete the whole index instead of older documentsElasticsearch curator 删除整个索引而不是旧文档
【发布时间】:2020-08-20 00:46:48
【问题描述】:

我有一个包含 1 年数据的索引。 我想删除旧数据并保留过去 60 天的数据。

我尝试使用 delete_query,这似乎有效,但非常耗时。

似乎“策展人”是做到这一点的最佳方式。

所以,我做了这个配置:

actions:
  1:
    action: delete_indices
    description: >-
      Delete indices older than 60 days.
    options:
      ignore_empty_list: True
      disable_action: False
    filters:
    - filtertype: pattern
      kind: prefix
      value: myindex*
    - filtertype: age
      source: field_stats
      direction: older
      unit: days
      unit_count: 60
      field: '@timestamp'
      stats_result: min_value

并使用 curator cli 启动它。

版本:curator 5.8 和 elasticsearch 6.5

结果不是预期的!

如果存在超过 60 天的数据,则会删除整个索引,而不是仅删除超过 60 天的数据。 你能帮我解决这个问题吗?

【问题讨论】:

    标签: elasticsearch elasticsearch-curator


    【解决方案1】:

    Curator 仅删除整个索引。从一开始就是这样。您有两个选择:坚持通过查询删除,或者将数据拆分为多个索引,以便随着时间的推移分块(整个索引)使其过期。由于翻转索引由单个别名支持,因此您的搜索仍会看到整个数据集(使用别名进行搜索时)。

    【讨论】:

    • 好的,谢谢!你有什么例子可以让这件事发生吗?或一些链接?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-05
    • 2019-06-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-03
    相关资源
    最近更新 更多