# Elastic search curator is failing

**URL:** <https://discuss.elastic.co/t/elastic-search-curator-is-failing/137447>\
**Category:** Elasticsearch\
**Created:** [June 26, 2018, 2:10pm UTC](https://discuss.elastic.co/t/elastic-search-curator-is-failing/137447 "2018-06-26T14:10:17Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeepnarla22322](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@sandeepnarla22322](https://discuss.elastic.co/u/sandeepnarla22322)\
**Post date:** [June 26, 2018, 2:10pm UTC](https://discuss.elastic.co/t/elastic-search-curator-is-failing/137447/1 "2018-06-26T14:10:18Z")

</div>

[root@BVELKL03 elasticsearch-curator]# curator\_cli --host localhost show\_indices --filter\_list '{"filtertype":"age","source":"name","timestring":"%Y.%m.%d","unit":"days","unit\_count":30}'  
2018-06-26 07:07:23,177 ERROR Schema error: required key not provided @ data['direction']  
2018-06-26 07:07:23,177 ERROR Schema error: Configuration: filter: Location: singleton, filter #0: {'filtertype': 'age', 'source': 'name', 'timestring': '%Y.%m.%d', 'unit': 'days', 'unit\_count': 30}: Bad Value: "(could not determine)", required key not provided @ data['direction']. Check configuration file.  
2018-06-26 07:07:23,177 CRITICAL Unable to parse filters: Configuration: filters: Location: show\_indices singleton action "filters": Bad Value: "None", Configuration: filter: Location: singleton, filter #0: {'filtertype': 'age', 'source': 'name', 'timestring': '%Y.%m.%d', 'unit': 'days', 'unit\_count': 30}: Bad Value: "(could not determine)", required key not provided @ data['direction']. Check configuration file.. Check configuration file.

I have the following error couldn't understand where to find of save the configuration file

---

<div class="post-metadata">

**Author:** ![sandeepnarla22322](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@sandeepnarla22322](https://discuss.elastic.co/u/sandeepnarla22322)\
**Post date:** [June 26, 2018, 4:55pm UTC](https://discuss.elastic.co/t/elastic-search-curator-is-failing/137447/2 "2018-06-26T16:55:41Z")

</div>

Hey i was able to fix this issue, but how do i make sure my indices are deleted  
root@BVELKL03 elasticsearch-curator]# curator\_cli --config curator.yml show\_indices --filter\_list '{"filtertype":"age","source":"name","timestring":"%Y.%m.%d","unit":"days","unit\_count":30}'

this is returning empty does this mean that the indices are deleted

---

<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 29, 2018, 8:42pm UTC](https://discuss.elastic.co/t/elastic-search-curator-is-failing/137447/3 "2018-06-29T20:42:45Z")

</div>

If you run `curator_cli --config curator.yml show_indices` _without_ a `--filter_list`, it will show you all indices in the cluster.

---

<div class="post-metadata">

**Author:** ![sandeepnarla22322](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@sandeepnarla22322](https://discuss.elastic.co/u/sandeepnarla22322)\
**Post date:** [July 2, 2018, 8:21pm UTC](https://discuss.elastic.co/t/elastic-search-curator-is-failing/137447/4 "2018-07-02T20:21:41Z")

</div>

@theuntergeek can you provide a sample to delete the indices which are not time based  
actions:  
1:  
action: delete\_snapshots  
description: \>-  
Delete indices older than 30 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:  
ignore\_empty\_list: True  
timeout\_override:  
continue\_if\_exception: False  
disable\_action: False  
filters:  
- filtertype: age  
source: field\_stats  
direction: older  
unit: hours  
unit\_count: 1

this is not working I have timebased indices and non time based indices

---

<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 2, 2018, 8:44pm UTC](https://discuss.elastic.co/t/elastic-search-curator-is-failing/137447/5 "2018-07-02T20:44:06Z")

</div>

To use [`source: field_stats`](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.5/filtertype_age.html#_literal_field_stats_literal_based_ages) you need to provide a [`field`](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.5/fe_field.html) name (if not `@timestamp`), as well as [`stats_result`](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.5/fe_stats_result.html) if not using `min_value` as the value for `stats_result`.

> [@sandeepnarla22322](#):
>
> can you provide a sample to delete the indices which are not time based

How will you determine which indices to delete? Index names alone? Will you need to exclude time-series indices?

---

<div class="post-metadata">

**Author:** ![sandeepnarla22322](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@sandeepnarla22322](https://discuss.elastic.co/u/sandeepnarla22322)\
**Post date:** [July 5, 2018, 3:44pm UTC](https://discuss.elastic.co/t/elastic-search-curator-is-failing/137447/6 "2018-07-05T15:44:03Z")

</div>

I have problem i want to delete indices irrespective of whether time based or non time based indices which are older than 7 days

---

<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 5, 2018, 4:22pm UTC](https://discuss.elastic.co/t/elastic-search-curator-is-failing/137447/7 "2018-07-05T16:22:47Z")

</div>

Your recourse is to use `source: creation_date`, which is set at index creation time:

```auto
- filtertype: age
  source: creation_date
  direction: older
  unit: days
  unit_count: 7

```

This will delete indices older than 7 days based on when they were created, with no regard to any other criteria but the index creation date.

---

<div class="post-metadata">

**Author:** ![sandeepnarla22322](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@sandeepnarla22322](https://discuss.elastic.co/u/sandeepnarla22322)\
**Post date:** [July 5, 2018, 5:05pm UTC](https://discuss.elastic.co/t/elastic-search-curator-is-failing/137447/8 "2018-07-05T17:05:51Z")

</div>

even after deleting i can data in kibana

---

<div class="post-metadata">

**Author:** ![sandeepnarla22322](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@sandeepnarla22322](https://discuss.elastic.co/u/sandeepnarla22322)\
**Post date:** [July 5, 2018, 7:12pm UTC](https://discuss.elastic.co/t/elastic-search-curator-is-failing/137447/9 "2018-07-05T19:12:36Z")

</div>

i meant to say al the indices which are older are available in kibana

---

<div class="post-metadata">

**Author:** ![sandeepnarla22322](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@sandeepnarla22322](https://discuss.elastic.co/u/sandeepnarla22322)\
**Post date:** [July 5, 2018, 7:29pm UTC](https://discuss.elastic.co/t/elastic-search-curator-is-failing/137447/10 "2018-07-05T19:29:47Z")

</div>

actions:  
1:  
action: delete\_indices  
description: \>-  
Delete indices older than 5 minutes.  
options:  
ignore\_empty\_list: True  
timeout\_override:  
continue\_if\_exception: False  
disable\_action: False  
filters:  
- filtertype: age  
source: creation\_date  
direction: older  
unit: days  
unit\_count: 7

unable to delete using the following actions2.yml

curator.yml

* * *

# Remember, leave a key empty if there is no value. None will be a string,

# not a Python "NoneType"

client:  
hosts:

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

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

---

<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 5, 2018, 9:04pm UTC](https://discuss.elastic.co/t/elastic-search-curator-is-failing/137447/11 "2018-07-05T21:04:15Z")

</div>

YAML is indent-sensitive. I can't troubleshoot your configuration without the original formatting preserved. Please use the `</>` code tags or encapsulate your pasted content inside of triple back ticks, like this:

````
```
PASTE HERE
```

````

Were there any logs resulting from your attempt?

---

<div class="post-metadata">

**Author:** ![sandeepnarla22322](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@sandeepnarla22322](https://discuss.elastic.co/u/sandeepnarla22322)\
**Post date:** [July 9, 2018, 2:32pm UTC](https://discuss.elastic.co/t/elastic-search-curator-is-failing/137447/12 "2018-07-09T14:32:09Z")

</div>

thanks untergreek i validated using yaml validator it resolved

curator\_cli --config curator.yml delete\_indices --filter\_list '{"filtertype":"age","source":"creation\_date","direction":"older","unit":"days","unit\_count":7}'

I am planning to use this command to delete the indices every in cron and I have an usecase where I want to delete few index patterns sesvg1,sppvg1,sppvg2 every 30 days and few index patterns named tmoes, sem every 7 days can you help on how to achieve using the same command

---

<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 6, 2018, 2:32pm UTC](https://discuss.elastic.co/t/elastic-search-curator-is-failing/137447/13 "2018-08-06T14:32:11Z")

</div>

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