# Curator date match does not meet provided criteria

**URL:** https://discuss.elastic.co/t/curator-date-match-does-not-meet-provided-criteria/262300
**Category:** Elasticsearch
**Tags:** curator
**Created:** [January 27, 2021, 12:55am UTC](https://discuss.elastic.co/t/curator-date-match-does-not-meet-provided-criteria/262300 "2021-01-27T00:55:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kyle\_che](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@kyle\_che](https://discuss.elastic.co/u/kyle_che)
#### Post date: [January 27, 2021, 12:55am UTC](https://discuss.elastic.co/t/curator-date-match-does-not-meet-provided-criteria/262300/1 "2021-01-27T00:55:51Z")

</div>

I'm trying to run curator and getting "does not meet provided criteria. Removing from list." Any idea on why the pattern below is not matching the index name?

```auto
  3:
    action: delete_indices
    description: >-
      Delete stats-v2-events-session-new indices older than 5 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: 'stats-v2-events-session-new-vhb-'
      exclude:
    - filtertype: age
      source: name
      direction: older
      timestring: '%d.%m.%Y '
      unit: days
      unit_count: 3
      exclude:

```

```auto
2021-01-27 00:51:19,427 DEBUG curator.indexlist filter_by_age:490 Filtering indices by age
2021-01-27 00:51:19,427 DEBUG curator.indexlist _get_name_based_ages:280 Getting ages of indices by "name"
2021-01-27 00:51:19,427 DEBUG curator.indexlist empty_list_check:226 Checking for empty list
2021-01-27 00:51:19,427 DEBUG curator.utils get_date_regex:195 Provided timestring = "%d.%m.%Y "
2021-01-27 00:51:19,427 DEBUG curator.utils get_date_regex:197 Current character: % Array position: 0
2021-01-27 00:51:19,427 DEBUG curator.utils get_date_regex:197 Current character: d Array position: 1
2021-01-27 00:51:19,427 DEBUG curator.utils get_date_regex:197 Current character: . Array position: 2
2021-01-27 00:51:19,427 DEBUG curator.utils get_date_regex:197 Current character: % Array position: 3
2021-01-27 00:51:19,427 DEBUG curator.utils get_date_regex:197 Current character: m Array position: 4
2021-01-27 00:51:19,427 DEBUG curator.utils get_date_regex:197 Current character: . Array position: 5
2021-01-27 00:51:19,427 DEBUG curator.utils get_date_regex:197 Current character: % Array position: 6
2021-01-27 00:51:19,427 DEBUG curator.utils get_date_regex:197 Current character: Y Array position: 7
2021-01-27 00:51:19,427 DEBUG curator.utils get_date_regex:197 Current character: Array position: 8
2021-01-27 00:51:19,427 DEBUG curator.utils get_date_regex:207 regex = \d{2}\.\d{2}\.\d{4} 
2021-01-27 00:51:19,427 DEBUG curator.indexlist working_list:237 Generating working list of indices
2021-01-27 00:51:19,428 DEBUG curator.indexlist working_list:237 Generating working list of indices
2021-01-27 00:51:19,428 DEBUG curator.indexlist filter_by_age:550 Index "stats-v2-events-session-new-vhb-23.1.2021" does not meet provided criteria. Removing from list.
2021-01-27 00:51:19,428 DEBUG curator.indexlist filter_by_age:550 Index "stats-v2-events-session-new-vhb-22.1.2021" does not meet provided criteria. Removing from list.
2021-01-27 00:51:19,428 DEBUG curator.indexlist filter_by_age:550 Index "stats-v2-events-session-new-vhb-21.1.2021" does not meet provided criteria. Removing from list.
2021-01-27 00:51:19,428 DEBUG curator.indexlist filter_by_age:550 Index "stats-v2-events-session-new-vhb-25.1.2021" does not meet provided criteria. Removing from list.
2021-01-27 00:51:19,428 DEBUG curator.indexlist filter_by_age:550 Index "stats-v2-events-session-new-vhb-19.1.2021" does not meet provided criteria. Removing from list.
2021-01-27 00:51:19,428 DEBUG curator.indexlist filter_by_age:550 Index "stats-v2-events-session-new-vhb-27.1.2021" does not meet provided criteria. Removing from list.
2021-01-27 00:51:19,428 DEBUG curator.indexlist filter_by_age:550 Index "stats-v2-events-session-new-vhb-20.1.2021" does not meet provided criteria. Removing from list.
2021-01-27 00:51:19,428 DEBUG curator.indexlist filter_by_age:550 Index "stats-v2-events-session-new-vhb-26.1.2021" does not meet provided criteria. Removing from list.

```

---

<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: [January 27, 2021, 9:42pm UTC](https://discuss.elastic.co/t/curator-date-match-does-not-meet-provided-criteria/262300/2 "2021-01-27T21:42:29Z")

</div>

Please see the warning, [A word about regular expression matching with timestrings](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.8/filtertype_age.html#_name_based_ages)

> [@kyle\_che](#):
>
> `timestring: '%d.%m.%Y '`

> [@kyle\_che](#):
>
> `19.1.2021`

Your month is not zero padded, and I would expect that single-digit days to also not be zero padded. This will result in the date not being recognized.

Unless the data inside does not correspond with the index creation date, I recommend using `creation_date` as your age filter `source`, rather than `name`. It removes this ambiguity by using the actual date stamp when the index was created. If you must use `name`, you'll have to fix your index naming algorithm to provide zero-padded days and months.

---

<div class="post-metadata">

### Author: ![kyle\_che](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@kyle\_che](https://discuss.elastic.co/u/kyle_che)
#### Post date: [January 28, 2021, 12:09am UTC](https://discuss.elastic.co/t/curator-date-match-does-not-meet-provided-criteria/262300/3 "2021-01-28T00:09:05Z")

</div>

> [@theuntergeek](#):
>
> creation\_date

thank you, that worked.

---

<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: [February 25, 2021, 12:09am UTC](https://discuss.elastic.co/t/curator-date-match-does-not-meet-provided-criteria/262300/4 "2021-02-25T00:09:11Z")

</div>

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