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

**URL:** <https://discuss.elastic.co/t/curator-is-it-possible-to-string-multiple-pattern-filters-into-a-single-action/65341>\
**Category:** Elasticsearch\
**Created:** [November 8, 2016, 11:13am UTC](https://discuss.elastic.co/t/curator-is-it-possible-to-string-multiple-pattern-filters-into-a-single-action/65341 "2016-11-08T11:13:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwgriffith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bwgriffith/32/7695_2.png) [@bwgriffith](https://discuss.elastic.co/u/bwgriffith)\
**Post date:** [November 8, 2016, 11:13am UTC](https://discuss.elastic.co/t/curator-is-it-possible-to-string-multiple-pattern-filters-into-a-single-action/65341/1 "2016-11-08T11:13:07Z")

</div>

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:

```
actions:
  1:
    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.
    options:
      ignore_empty_list: True
      timeout_override:
      continue_if_exception: False
      disable_action: False
    filters:
    - filtertype: pattern
      kind: prefix
      value: .watch_history- 
      exclude:
    - filtertype: pattern
      kind: prefix
      value: .shield_audit_log- 
      exclude:
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 7
      exclude:

```

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [November 8, 2016, 1:23pm UTC](https://discuss.elastic.co/t/curator-is-it-possible-to-string-multiple-pattern-filters-into-a-single-action/65341/2 "2016-11-08T13:23:26Z")

</div>

> [@bwgriffith](#):
>
> ```auto
> - filtertype: pattern
> kind: prefix
> value: .watch_history- 
> exclude:
> - filtertype: pattern
> kind: prefix
> value: .shield_audit_log- 
> exclude:
> 
> ```

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:

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

```

or something like that.

---

<div class="post-metadata">

**Author:** ![bwgriffith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bwgriffith/32/7695_2.png) [@bwgriffith](https://discuss.elastic.co/u/bwgriffith)\
**Post date:** [November 8, 2016, 1:41pm UTC](https://discuss.elastic.co/t/curator-is-it-possible-to-string-multiple-pattern-filters-into-a-single-action/65341/3 "2016-11-08T13:41:38Z")

</div>

Gotcha... that did the trick.

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 6, 2016, 1:41pm UTC](https://discuss.elastic.co/t/curator-is-it-possible-to-string-multiple-pattern-filters-into-a-single-action/65341/4 "2016-12-06T13:41:50Z")

</div>

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