# Problem with Deleting old indices using curator

**URL:** https://discuss.elastic.co/t/problem-with-deleting-old-indices-using-curator/139635
**Category:** Elasticsearch
**Created:** [July 11, 2018, 7:13pm UTC](https://discuss.elastic.co/t/problem-with-deleting-old-indices-using-curator/139635 "2018-07-11T19:13:45Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ELK\_developer99](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@ELK\_developer99](https://discuss.elastic.co/u/ELK_developer99)
#### Post date: [July 11, 2018, 7:13pm UTC](https://discuss.elastic.co/t/problem-with-deleting-old-indices-using-curator/139635/1 "2018-07-11T19:13:45Z")

</div>

Trying to delete old indices using curator. I have indices in the following format:  
{name}-{%m%d}. For example: "john-0709" or "jane-0702". Here is my action file:

actions:  
1:  
action: delete\_indices

```
    filters:
           # - filtertype: pattern
           # kind: prefix
           # value: .kibana
          # exclude: True

          - filtertype: pattern
            kind: prefix
            value: john

          - filtertype: age
            source: name
            direction: older
            timestring: '%m%d'
            unit: days
            unit_count: 10
            exclude:

```

* * *

However, it ends up deleting all indices (--dry-run) irrespective of the date.  
What am I missing?

---

<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: [July 11, 2018, 7:29pm UTC](https://discuss.elastic.co/t/problem-with-deleting-old-indices-using-curator/139635/2 "2018-07-11T19:29:20Z")

</div>

I suggest running with a DEBUG `loglevel` and run with `--dry-run` again. It will provide the UNIX epoch time stamps in the log files, and why it says index `x` is older than your set point.

---

<div class="post-metadata">

### Author: ![ELK\_developer99](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@ELK\_developer99](https://discuss.elastic.co/u/ELK_developer99)
#### Post date: [July 11, 2018, 7:42pm UTC](https://discuss.elastic.co/t/problem-with-deleting-old-indices-using-curator/139635/3 "2018-07-11T19:42:54Z")

</div>

curator --debug loglevel --config ~curator.yml ~/tmp/del\_old\_indices.yml --dry-run  
gives me an error. Is that the right usage?

---

<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: [July 11, 2018, 8:58pm UTC](https://discuss.elastic.co/t/problem-with-deleting-old-indices-using-curator/139635/4 "2018-07-11T20:58:09Z")

</div>

`loglevel` is set in the `curator.yml` file:

```auto
logging:
  loglevel: DEBUG

```

---

<div class="post-metadata">

### Author: ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)
#### Post date: [July 12, 2018, 3:01am UTC](https://discuss.elastic.co/t/problem-with-deleting-old-indices-using-curator/139635/5 "2018-07-12T03:01:30Z")

</div>

> [@ELK\_developer99](#):
>
> source: name

try  
source: creation\_date

---

<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: [July 12, 2018, 1:24pm UTC](https://discuss.elastic.co/t/problem-with-deleting-old-indices-using-curator/139635/6 "2018-07-12T13:24:57Z")

</div>

`creation_date` _may_ help. If the indices were not created at the same time as the dates indicated in the index names, it will not, however. That's why I suggested debug logging first.

---

<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: [August 9, 2018, 1:25pm UTC](https://discuss.elastic.co/t/problem-with-deleting-old-indices-using-curator/139635/7 "2018-08-09T13:25:09Z")

</div>

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