# Managing Old indices

**URL:** <https://discuss.elastic.co/t/managing-old-indices/73850>\
**Category:** Elasticsearch\
**Created:** [February 3, 2017, 12:29pm UTC](https://discuss.elastic.co/t/managing-old-indices/73850 "2017-02-03T12:29:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Morten\_Voss](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@Morten\_Voss](https://discuss.elastic.co/u/Morten_Voss)\
**Post date:** [February 3, 2017, 12:29pm UTC](https://discuss.elastic.co/t/managing-old-indices/73850/1 "2017-02-03T12:29:09Z")

</div>

Hey, I am fairly new to elasticsearch, and was wondering what the best practices are for automatically removing indices older than xx days and if it is possible to also automatically compress closed indices.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 3, 2017, 12:40pm UTC](https://discuss.elastic.co/t/managing-old-indices/73850/2 "2017-02-03T12:40:36Z")

</div>

Curator tool will help a lot.

---

<div class="post-metadata">

**Author:** ![Morten\_Voss](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@Morten\_Voss](https://discuss.elastic.co/u/Morten_Voss)\
**Post date:** [February 3, 2017, 1:12pm UTC](https://discuss.elastic.co/t/managing-old-indices/73850/3 "2017-02-03T13:12:54Z")

</div>

Yeah, I actually tried that with some of the older versions of elasticsearch. And I have it working for closing indices.  
I can't seem to get the action-delete.yml to work though.  
My file looks like this.

```
actions:
 1:
    action: delete_indices
      description: >-
      Delete indices older than 7 days (based on index name), for logstash-
      prefixed indices.
    options:
      ignore_empty_list: True
      delete_aliases: False
      timeout_override:
      continue_if_exception: False
      disable_action: False
    filters:
    - filtertype: pattern
      kind: prefix
      value: logstash-xxx-
      exclude:
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 7
      exclude:

```

and it just gives me this error  
curator.exceptions.ConfigurationError: Configuration: options: Location: Action ID "1", action "delete\_indices": Bad Value: "False", extra keys not allowed @ data['delete\_aliases']. Check configuration file.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 3, 2017, 2:08pm UTC](https://discuss.elastic.co/t/managing-old-indices/73850/4 "2017-02-03T14:08:46Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

I'm sure @theuntergeek can 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:** [February 3, 2017, 5:38pm UTC](https://discuss.elastic.co/t/managing-old-indices/73850/5 "2017-02-03T17:38:41Z")

</div>

> [@Morten\_Voss](#):
>
> ```auto
> curator.exceptions.ConfigurationError: Configuration: options: Location: Action ID "1", action "delete_indices": Bad Value: "False", extra keys not allowed @ data['delete_aliases']. Check configuration file.
> 
> ```

You have `delete_aliases` in your `options` section. That option [only works in a `close` action](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/option_delete_aliases.html).

---

<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:** [March 3, 2017, 5:38pm UTC](https://discuss.elastic.co/t/managing-old-indices/73850/6 "2017-03-03T17:38:45Z")

</div>

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