# Deleting indices 30 days older

**URL:** https://discuss.elastic.co/t/deleting-indices-30-days-older/89686
**Category:** Elasticsearch
**Created:** [June 16, 2017, 10:04am UTC](https://discuss.elastic.co/t/deleting-indices-30-days-older/89686 "2017-06-16T10:04:30Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Vivek\_Samaga](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivek_samaga/32/43285_2.png) [@Vivek\_Samaga](https://discuss.elastic.co/u/Vivek_Samaga)
#### Post date: [June 16, 2017, 10:04am UTC](https://discuss.elastic.co/t/deleting-indices-30-days-older/89686/1 "2017-06-16T10:04:30Z")

</div>

Hi am using Curator V 4.3.1 to delete the indices in my ES V 2.2.0  
My action.yml looks like this

```
actions:
  1:
    action: delete_indices
    description: >-
      Delete indices older than 28 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: 9999999
      continue_if_exception: False
      disable_action: False
    filters:
    - filtertype: pattern
      kind: prefix
      value: idmcrt-
      exclude:
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 30
      exclude:

```

The problem is this is not working as expected,  
instead of deleting the indices which are older than 30 days it's including the recent indices as well.

---

<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: [June 16, 2017, 10:41am UTC](https://discuss.elastic.co/t/deleting-indices-30-days-older/89686/2 "2017-06-16T10:41:20Z")

</div>

Without more information it will be hard to know what it is you're describing. Can you share the log lines that Curator made? Particularly the ones showing it deleting indices not matching the patterns you've provided.

---

<div class="post-metadata">

### Author: ![Vivek\_Samaga](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivek_samaga/32/43285_2.png) [@Vivek\_Samaga](https://discuss.elastic.co/u/Vivek_Samaga)
#### Post date: [June 16, 2017, 11:02am UTC](https://discuss.elastic.co/t/deleting-indices-30-days-older/89686/3 "2017-06-16T11:02:35Z")

</div>

It is matching the particular pattern **idmcrt-** no problem with that.  
Flushing out all the indices is the problem. So below is the action.log file once i ran the curator with action file.  
It is deleting all the indices, not only the indices which are older than 30 days.

```
2017-06-16 04:54:57,281 INFO ---deleting index idmcrt-2016.05.31
2017-06-16 04:54:57,281 INFO ---deleting index idmcrt-2016.05.30
2017-06-16 04:54:57,281 INFO ---deleting index idmcrt-2016.06.01
2017-06-16 04:54:57,281 INFO ---deleting index idmcrt-2016.05.28
2017-06-16 04:54:57,281 INFO ---deleting index idmcrt-2016.05.29
2017-06-16 04:54:57,281 INFO ---deleting index idmcrt-2016.05.27
2017-06-16 04:55:07,142 INFO Action ID: 1, "delete_indices" completed.
2017-06-16 04:55:07,142 INFO Job completed.
```

---

<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: [June 16, 2017, 12:45pm UTC](https://discuss.elastic.co/t/deleting-indices-30-days-older/89686/4 "2017-06-16T12:45:54Z")

</div>

As you can see from the logs you pasted, Curator lists every index it deletes. If it isn't listed, it is highly unlikely that Curator deleted it. If you're experiencing other indices being deleted, and still think it's Curator, you'll need to run Curator with `loglevel: DEBUG`, and `blacklist: []`. The `blacklist` part is critical, because with this setting, you'll be able to see _every_ call made to Elasticsearch. If something unexpected were happening, it would be visible there.

---

<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 14, 2017, 12:46pm UTC](https://discuss.elastic.co/t/deleting-indices-30-days-older/89686/5 "2017-07-14T12:46:02Z")

</div>

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