# \[RESOLVED\] Remove all old indices with Curator

**URL:** https://discuss.elastic.co/t/resolved-remove-all-old-indices-with-curator/64438
**Category:** Elasticsearch
**Created:** [October 31, 2016, 11:58am UTC](https://discuss.elastic.co/t/resolved-remove-all-old-indices-with-curator/64438 "2016-10-31T11:58:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![apelsina](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@apelsina](https://discuss.elastic.co/u/apelsina)
#### Post date: [October 31, 2016, 11:58am UTC](https://discuss.elastic.co/t/resolved-remove-all-old-indices-with-curator/64438/1 "2016-10-31T11:58:37Z")

</div>

Hi all!

I am trying to use Curator to manage my indices. All I need now is to remove all indices older than several days. I am able to define a pattern with every specific index name and it worked. But all I want is actually to remove all old indices with one action. I tried to use regex for all names for that and it didn't work. I get an error like this:

`2016-10-31 14:37:34,941 ERROR Failed to complete action: delete_indices. <class 'sre_constants.error'>: nothing to repeat`

Here's my actions.yml file:  
`--- actions: 1: action: delete_indices description: >- Delete indices older than 10 days (based on index name), for all 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: regex value: '^*.-*$' exclude: - filtertype: age source: name direction: older timestring: '%Y.%m.%d' unit: days unit_count: 10 exclude:`

And I have no idea of what the regex should be.  
I've also tried regexes like `*`, `*-*`, `*.-*` and nothing worked.  
I guess this is pretty simple issue but I could not find any simple simple solution for it.

I use python-elasticsearch-curator 4.1.2

Thank you in advance.

---

<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: [October 31, 2016, 12:54pm UTC](https://discuss.elastic.co/t/resolved-remove-all-old-indices-with-curator/64438/2 "2016-10-31T12:54:05Z")

</div>

If you're trying to delete all older indices with a hyphen in them, try `'^.*-.*$'`.

---

<div class="post-metadata">

### Author: ![apelsina](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@apelsina](https://discuss.elastic.co/u/apelsina)
#### Post date: [October 31, 2016, 4:01pm UTC](https://discuss.elastic.co/t/resolved-remove-all-old-indices-with-curator/64438/3 "2016-10-31T16:01:44Z")

</div>

That worked!

Thank you so much.

---

<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: [July 5, 2017, 10:08pm UTC](https://discuss.elastic.co/t/resolved-remove-all-old-indices-with-curator/64438/4 "2017-07-05T22:08:12Z")

</div>


