0

背景:

elasticsearch version 6.2
curator version 5.4.1.

现在我可以使用 curator 删除一个订购 7 天的索引,但是我有多个索引并且我不想创建多个 action.yml,例如:

actions:
  1:
    action: delete_indices
    description: >-
        Delete indices older than 7 days (based on index name), for student-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: False
    filters:
        - filtertype: pattern
          kind: prefix
          value: student=
        - filtertype: age
          source: name
          direction: older
          timestring: '%Y-%m-%d'
          unit: days
          unit_count: 7

根据这个action.yml,它删除了student=2017-XX-XX。但是我有很多指标,比如老师、家长等等。我用 *= 替换了 studnet= 但不起作用。

那么我能做什么呢?非常感谢。

4

1 回答 1

0

你尝试几件事。一些例子包括:

  1. 您可以省略pattern过滤器类型,只留下age. 但是,这可能会删除其他具有%Y-%m-%d模式的索引。在这种情况下,您可能会使用不同的pattern过滤器,但要排除您不想删除的模式: 用它 - filtertype: pattern kind: prefix value: omit_me exclude: true 替换您的pattern过滤器将删除所有%Y-%m-%d超过 7 天的索引,除了omit_me.
  2. 您可以设置 aregex而不是 a prefix。例如: 这将匹配以、或 - filtertype: pattern kind: regex value: '^(student|parent|teacher).*$' 开头的索引。studentparentteacher
于 2018-03-12T13:32:42.023 回答