0

我有一个包含 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 天的数据。你能帮我吗?

4

1 回答 1

1

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

于 2020-08-19T16:46:48.097 回答