Curator - Is it possible to string multiple pattern filters into a single action

(Bwgriffith) #1

I was wondering if it was possible to string multiple pattern type matches into a single curator action. Mainly trying to minimize the number of individual actions.

An example of what I'm trying to do, but it does not return any matches is:

    action: delete_indices
    description: >-
      Delete indices older than 30 days (based on index name), for logstash-
      prefixed indices. Ignore the error if the filter does not result in an
      actionable list of indices (ignore_empty_list) and exit cleanly.
      ignore_empty_list: True
      continue_if_exception: False
      disable_action: False
    - filtertype: pattern
      kind: prefix
      value: .watch_history- 
    - filtertype: pattern
      kind: prefix
      value: .shield_audit_log- 
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 7

Any help would be appreciated.

(Aaron Mildenstein) #2

You will, of course, see nothing here, because you're telling it to only include indices that start with .watch_history and also only start with .shield_audit_log. There's nothing left to try to delete older than 7 days worth.

If you are trying to delete both in one shot, you'll need to use kind: regex instead of prefix, and set it accordingly.

It might look something like:

kind: regex
value: '^(\.watch_history-|\.shield_audit_log).*$'

or something like that.

(Bwgriffith) #3

Gotcha... that did the trick.


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.