# \[solved\]I want to delete the indices that are older than 1 day?

**URL:** <https://discuss.elastic.co/t/solved-i-want-to-delete-the-indices-that-are-older-than-1-day/77348>\
**Category:** Elasticsearch\
**Created:** [March 3, 2017, 6:47pm UTC](https://discuss.elastic.co/t/solved-i-want-to-delete-the-indices-that-are-older-than-1-day/77348 "2017-03-03T18:47:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [March 3, 2017, 6:47pm UTC](https://discuss.elastic.co/t/solved-i-want-to-delete-the-indices-that-are-older-than-1-day/77348/1 "2017-03-03T18:47:30Z")

</div>

i used curator 4.2.6 . I want to delete the indices that are 1 day older. I used the following command:

CONFIG file  
client:  
hosts:  
- 127.0.0.1  
port: 9200  
url\_prefix:  
use\_ssl: False  
certificate:  
client\_cert:  
client\_key:  
aws\_key:  
aws\_secret\_key:  
aws\_region:  
ssl\_no\_validate: False  
http\_auth:  
timeout: 30  
master\_only: False

logging:  
loglevel: INFO  
logfile:  
logformat: default  
blacklist: ['elasticsearch', 'urllib3']

ACTION file  
actions:  
1:  
action: delete\_indices  
description: "Delete indices older than 1 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:  
timeout\_override:  
continue\_if\_exception: False  
disable\_action: False  
filters:

- filtertype: pattern  
kind: prefix  
value: data  
exclude:
- filtertype: age  
source: name  
direction: older  
timestring: '%Y-%m-%d'  
unit: days  
unit\_count: 1  
exclude:

my index is in this format data-2017-03-01

I am getting error like this:

```
F:\Curator\curator-4.2.6-win32>curator --config F:\Curator\curator-4.2.6-win32\config.yml F:\Curator\curator-4.2.6-win32\action.yml
2017-03-04 00:48:15,217 ERROR Schema error: extra keys not allowed @ data[1]
Configuration: Actions File: Location: root: Bad Value: "None", extra keys not allowed @ data[1]. Check configuration file.

```

Thanks..

---

<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:** [March 3, 2017, 7:23pm UTC](https://discuss.elastic.co/t/solved-i-want-to-delete-the-indices-that-are-older-than-1-day/77348/2 "2017-03-03T19:23:20Z")

</div>

Please encapsulate your yaml files in lines containing only triple backticks ```  
One above your text, and one below. Without this, I can't tell if your files are properly indented.

---

<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:** [March 3, 2017, 7:25pm UTC](https://discuss.elastic.co/t/solved-i-want-to-delete-the-indices-that-are-older-than-1-day/77348/3 "2017-03-03T19:25:25Z")

</div>

The first thing that jumps out is that you can't have a multiline `description` unless you start with `description: ->`

See the example for [`delete_indices`](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/ex_delete_indices.html) in the [Official Curator Documentation](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html)

---

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [March 3, 2017, 7:29pm UTC](https://discuss.elastic.co/t/solved-i-want-to-delete-the-indices-that-are-older-than-1-day/77348/4 "2017-03-03T19:29:00Z")

</div>

Thanks..  
I COPIED the config file from [github](https://github.com/elastic/curator/blob/master/examples/curator.yml) and pasted as it is in config file.  
I will correct the description and let u know..  
Thanks

---

<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:** [March 3, 2017, 7:32pm UTC](https://discuss.elastic.co/t/solved-i-want-to-delete-the-indices-that-are-older-than-1-day/77348/5 "2017-03-03T19:32:41Z")

</div>

The issue isn't the config file, it is the action file.

---

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [March 3, 2017, 7:37pm UTC](https://discuss.elastic.co/t/solved-i-want-to-delete-the-indices-that-are-older-than-1-day/77348/6 "2017-03-03T19:37:20Z")

</div>

Thanks .. i got it

For sending the last 3 day indices to snapshot in azure, do i have to provide azure account name and number in config file?

OR is it enough to declare them in elasticsearch.yml file because i am using azure plugin?  
Thanks

---

<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:** [March 3, 2017, 7:50pm UTC](https://discuss.elastic.co/t/solved-i-want-to-delete-the-indices-that-are-older-than-1-day/77348/7 "2017-03-03T19:50:05Z")

</div>

Please keep the discussion on topic. The topic is deleting indices older than 1 day. Snapshots and Azure do not enter in to such a discussion.

---

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [March 3, 2017, 7:51pm UTC](https://discuss.elastic.co/t/solved-i-want-to-delete-the-indices-that-are-older-than-1-day/77348/8 "2017-03-03T19:51:23Z")

</div>

sorry..got that

---

<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 31, 2017, 7:51pm UTC](https://discuss.elastic.co/t/solved-i-want-to-delete-the-indices-that-are-older-than-1-day/77348/9 "2017-03-31T19:51:23Z")

</div>

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