# Delete Index automaticly with curator

**URL:** <https://discuss.elastic.co/t/delete-index-automaticly-with-curator/92597>\
**Category:** Elasticsearch\
**Created:** [July 11, 2017, 7:51am UTC](https://discuss.elastic.co/t/delete-index-automaticly-with-curator/92597 "2017-07-11T07:51:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam67000](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@Sam67000](https://discuss.elastic.co/u/Sam67000)\
**Post date:** [July 11, 2017, 7:51am UTC](https://discuss.elastic.co/t/delete-index-automaticly-with-curator/92597/1 "2017-07-11T07:51:31Z")

</div>

Hello EveryOne,

```
My curator action file is as follows : 
 
actions:
  1:
    action: delete_indices
    description: >-Delete indices 
    options:
      continue_if_exception: False
    filters:
     - filtertype: space
       disk_space: 0.2
       use_age: True
       source: creation_date

```

I wanted to know if this action will remove all indexes exceeding 200 MB or if curator delete the oldest indexes if the size of all indexes exceeds 200 MB ?

Thank you for help !

---

<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, 2017, 5:28pm UTC](https://discuss.elastic.co/t/delete-index-automaticly-with-curator/92597/2 "2017-07-11T17:28:34Z")

</div>

I _highly_ recommend not deleting all indices by space without adding additional filters (to prevent your `.kibana` index from being deleted, for example).

Yes, your provided example will delete all indices in excess of 200MB, starting with the oldest by `creation_date`. I recommend running this with the `--dry-run` flag so you can see exactly what would be deleted before you actually run it. The indices which would have been deleted will be in the logs. Or, you can run `curator_cli` with this filter and the `show_indices` action:

```auto
curator_cli show_indices --filter_list '{"filtertype":"space","disk_space":0.2,"use_age":"True","source":"creation_date"}'

```

---

<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 8, 2017, 5:28pm UTC](https://discuss.elastic.co/t/delete-index-automaticly-with-curator/92597/3 "2017-08-08T17:28:43Z")

</div>

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