# Curator delete\_indices doesn't

**URL:** <https://discuss.elastic.co/t/curator-delete-indices-doesnt/135154>\
**Category:** Elasticsearch\
**Created:** [June 8, 2018, 12:37pm UTC](https://discuss.elastic.co/t/curator-delete-indices-doesnt/135154 "2018-06-08T12:37:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamcheney](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@adamcheney](https://discuss.elastic.co/u/adamcheney)\
**Post date:** [June 8, 2018, 12:37pm UTC](https://discuss.elastic.co/t/curator-delete-indices-doesnt/135154/1 "2018-06-08T12:37:54Z")

</div>

Hi folks,

Please accept a pre-emptive apology for what might be a dumb, noob question...!

Elasticsearch 6.2  
Curator 5.5

I'm trying to set up a simple curator job to clean up old indices. I've been playing around with curator\_cli, and this seems to work perfectly:  
`curator_cli --ssl-no-validate --use_ssl --http_auth $ELASTICAUTH --host localhost --port 9200 show_indices --filter_list '[{"filtertype":"pattern","kind":"regex","value":"'^ros\.lostlogs\..*'"},{"filtertype":"age","source":"creation_date","unit":"days","unit_count":6,"direction":"older"}]'`

This produces a series of warnings about the unverified https request and then this:

```auto
ros.lostlogs.30sec-20180602
ros.lostlogs.60sec-20180602
ros.lostlogs.fiftynine-20180601
ros.lostlogs.fiftynine-20180602
ros.lostlogs.ninetysecs-20180602
ros.lostlogs.oneeightysecs-20180602
ros.lostlogs.onetwentysecs-20180602
ros.lostlogs.sixtysecsasync-20180602

```

This also works if I choose delete\_indices...

I'd really like to use curator, though, because of the greater flexibility offered by the action file. Here is my conf file:

```auto
---
client:
  hosts:
    - 127.0.0.1
  port: 9200
  url_prefix:
  use_ssl: True
  certificate:
  client_cert:
  client_key:
  ssl_no_validate: True
  http_auth: $ELASTICAUTH
  timeout: 30
  master_only: False

logging:
  loglevel: DEBUG
  logfile:
  logformat: default
  blacklist: []

```

And here is my action file (the second action is intentionally disabled at this time):

```auto
---
actions:
  1:
    action: delete_indices
    description: Delete RoS indices where creation date is older than 30 days
    options:
      ignore_empty_list: False
      disable_action: False
    filters:
      - filtertype: pattern
        kind: regex
        value: '^ros\.lostlogs\..*'
      - filtertype: age
        source: creation_date
        direction: older
        unit: days
        unit_count: 6
  2:
    action: delete_indices
    description: Delete indices with %Y.%m.%d in the name where that date is older than 30 days
    options:
      ignore_empty_list: False
      disable_action: True
    filters:
      - filtertype: age
        source: name
        direction: older
        timestring: %Y.%m.%d
        unit: days
        unit_count: 30

```

Running the curator command produces this output:

```auto
curator --config ./curator.yml ./clean30dIndices.yml
2018-06-08 13:27:42,034 DEBUG curator.cli run:108 Client and logging options validated.
2018-06-08 13:27:42,035 DEBUG curator.cli run:112 default_timeout = 30
2018-06-08 13:27:42,035 DEBUG curator.cli run:116 action_file: ./clean30dIndices.yml

```

But none of those indices are deleted (as proven by re-running the curator\_cli command above).

I'm sure it's my error - can someone please help me find it?

Cheers - Adam...

---

<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 8, 2018, 3:22pm UTC](https://discuss.elastic.co/t/curator-delete-indices-doesnt/135154/2 "2018-06-08T15:22:53Z")

</div>

It means that there's something about the YAML in your action file that Curator couldn't read/validate (not the content, the YAML formatting). I would hazard two possibilities:

1. SIngle-quote encapsulate your `timestring`s, including the `description` blocks (for those, single quoting the entire line would work).
2. You've used a stray tab character somewhere

I'm working on a better way to report that there was a yaml parsing error, because this is happening too often.

---

<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 6, 2018, 3:22pm UTC](https://discuss.elastic.co/t/curator-delete-indices-doesnt/135154/3 "2018-07-06T15:22:57Z")

</div>

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