# Curator\_cli, indices, and a new server to me

**URL:** <https://discuss.elastic.co/t/curator-cli-indices-and-a-new-server-to-me/174138>\
**Category:** Elasticsearch\
**Created:** [March 27, 2019, 2:04pm UTC](https://discuss.elastic.co/t/curator-cli-indices-and-a-new-server-to-me/174138 "2019-03-27T14:04:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bithead008](https://avatars.discourse-cdn.com/v4/letter/b/45deac/32.png) [@bithead008](https://discuss.elastic.co/u/bithead008)\
**Post date:** [March 27, 2019, 2:04pm UTC](https://discuss.elastic.co/t/curator-cli-indices-and-a-new-server-to-me/174138/1 "2019-03-27T14:04:26Z")

</div>

I turned on debug output because the indices don't seem to be getting cleaned and the machine is running out of disk space. This machine was restored from a backup and I believe that it wasn't quiesced so perhaps Elasticsearch is unhappy about some corruption?

I have no idea how to remedy this as this is a new server to me. Any hints you guys can give me?

# curator\_cli --version

curator\_cli, version 5.6.0

# /usr/local/sbin/clean\_indices.sh

- curator\_cli --loglevel DEBUG --logfile /tmp/clean\_indices.log --host 10.155.6.20 --port 8881 --ssl-no-validate --http\_auth logreader:SomePassword --timeout=180 delete\_indices --filter\_list '{"filtertype":"age","source":"name","timestring":"%Y.%m.%d","unit":"days","unit\_count":60,"direction":"older"}'

# more /tmp/clean\_indices.log

2019-03-27 13:57:55,212 DEBUG curator.cli\_singletons.cli\_action.delete\_indices check\_options:96 Validating provided options: {'allow\_ilm\_indices': False}  
2019-03-27 13:57:55,215 DEBUG curator.validators.SchemaCheck **init** :26 Schema: {'allow\_ilm\_indices': Any(\<class 'bool'\>, All(Any(\<class 'str'\>, msg=None), \<function  
Boolean at 0x7f3444eb26a8\>, msg=None), msg=None), 'continue\_if\_exception': Any(\<class 'bool'\>, All(Any(\<class 'str'\>, msg=None), \<function Boolean at 0x7f3444eb2840\>, msg=None), msg=Non  
e), 'disable\_action': Any(\<class 'bool'\>, All(Any(\<class 'str'\>, msg=None), \<function Boolean at 0x7f3444eb29d8\>, msg=None), msg=None), 'ignore\_empty\_list': Any(\<class 'bool'\>, All(Any(\<  
class 'str'\>, msg=None), \<function Boolean at 0x7f3444eb2b70\>, msg=None), msg=None), 'timeout\_override': Any(Coerce(int, msg=None), None, msg=None)}  
2019-03-27 13:57:55,216 DEBUG curator.validators.SchemaCheck **init** :27 "options" config: {'allow\_ilm\_indices': False}  
2019-03-27 13:57:55,216 DEBUG curator.cli\_singletons.cli\_action.delete\_indices check\_filters:117 Validating provided filters: [{'filtertype': 'age', 'source': 'name', 'time  
string': '%Y.%m.%d', 'unit': 'days', 'unit\_count': 60, 'direction': 'older'}]  
2019-03-27 13:57:55,216 DEBUG curator.validators.SchemaCheck **init** :26 Schema: \<function Filters..f at 0x7f3444eb2378\>  
2019-03-27 13:57:55,216 DEBUG curator.validators.SchemaCheck **init** :27 "filters" config: [{'filtertype': 'age', 'source': 'name', 'timestring': '%Y.%m.%d', 'unit':  
'days', 'unit\_count': 60, 'direction': 'older'}]  
2019-03-27 13:57:55,216 DEBUG curator.defaults.filtertypes age:55 AGE FILTER = [{'direction': Any('older', 'younger', msg=None)}, {'unit': Any('seconds', 'minute  
s', 'hours', 'days', 'weeks', 'months', 'years', msg=None)}, {'unit\_count': Coerce(int, msg=None)}, {'unit\_count\_pattern': Any(\<class 'str'\>, msg=None)}, {'epoch': Any(Coerce(int, msg=No  
ne), None, msg=None)}, {'exclude': Any(\<class 'bool'\>, All(Any(\<class 'str'\>, msg=None), \<function Boolean at 0x7f3444f1c488\>, msg=None), msg=None)}, {'source': Any('name', 'creation\_dat  
e', 'field\_stats', msg=None)}, {'stats\_result': Any('min\_value', 'max\_value', msg=None)}, {'timestring': Any(\<class 'str'\>, msg=None)}]  
2019-03-27 13:57:55,217 DEBUG curator.validators.SchemaCheck **init** :26 Schema: {'filtertype': Any(In(['age', 'alias', 'allocated', 'closed', 'count', 'empty', 'forc  
emerged', 'ilm', 'kibana', 'none', 'opened', 'pattern', 'period', 'shards', 'space', 'state']), msg="filtertype must be one of ['age', 'alias', 'allocated', 'closed', 'count', 'empty', '  
forcemerged', 'ilm', 'kibana', 'none', 'opened', 'pattern', 'period', 'shards', 'space', 'state']"), 'direction': Any('older', 'younger', msg=None), 'unit': Any('seconds', 'minutes', 'ho  
urs', 'days', 'weeks', 'months', 'years', msg=None), 'unit\_count': Coerce(int, msg=None), 'unit\_count\_pattern': Any(\<class 'str'\>, msg=None), 'epoch': Any(Coerce(int, msg=None), None, ms  
g=None), 'exclude': Any(\<class 'bool'\>, All(Any(\<class 'str'\>, msg=None), \<function Boolean at 0x7f3444f1c488\>, msg=None), msg=None), 'source': Any('name', 'creation\_date', 'field\_stats'  
, msg=None), 'stats\_result': Any('min\_value', 'max\_value', msg=None), 'timestring': Any(\<class 'str'\>, msg=None)}  
2019-03-27 13:57:55,217 DEBUG curator.validators.SchemaCheck **init** :27 "filter" config: {'filtertype': 'age', 'source': 'name', 'timestring': '%Y.%m.%d', 'unit': 'd  
ays', 'unit\_count': 60, 'direction': 'older'}  
2019-03-27 13:57:55,217 DEBUG curator.validators.filters f:48 Filter #0: {'filtertype': 'age', 'source': 'name', 'timestring': '%Y.%m.%d', 'unit': 'days', 'uni  
t\_count': 60, 'direction': 'older', 'epoch': None, 'stats\_result': 'min\_value', 'exclude': False}  
2019-03-27 13:57:55,217 DEBUG curator.utils get\_client:802 kwargs = {'hosts': ['10.155.6.20'], 'port': 8881, 'use\_ssl': False, 'timeout': 180, 'master\_only': Fa  
lse, 'url\_prefix': '', 'aws\_sign\_request': False, 'http\_auth': 'logreader:SomePassword', 'ssl\_no\_validate': True, 'certificate': None, 'aws\_secret\_key': None, 'aws\_token': None, 'client\_cert  
': None, 'aws\_key': None, 'client\_key': None}  
2019-03-27 13:57:55,221 DEBUG curator.utils get\_client:879 Not using "requests\_aws4auth" python module to connect.

---

<div class="post-metadata">

**Author:** ![A\_B](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_b/32/17104_2.png) [@A\_B](https://discuss.elastic.co/u/A_B)\
**Post date:** [March 27, 2019, 2:16pm UTC](https://discuss.elastic.co/t/curator-cli-indices-and-a-new-server-to-me/174138/2 "2019-03-27T14:16:22Z")

</div>

When troubleshooting `curator_cli` I always start as simple as possible and try to just list some indices. Once that works then I try to action them...

I have a wrapper script for `usr/local/bin/curator_cli` which is

```
# cat /usr/local/bin/curator_delete.sh
#!/bin/bash

set -o nounset
set -o errexit

usage="$(basename "$0") [-h] [-p foo] [-s bar] [-d n] -- delete old Elasticsearch indices using curator

where:
    -h show this help text
    -p index pattern (start of index name)
    -s Elasticsearch server to run command against
    -d delete indices older than, in days (default: )
    -x add to -d to delete more indices (for use with sensu check hooks)"

DAYS=
EXTRA_DAYS=0

while getopts ":hp:s:d:x:" option; do
  case $option in
    h) echo "$usage"
       exit
       ;;
    d) DAYS=$OPTARG
       ;;
    x) EXTRA_DAYS=$OPTARG
       ;;
    p) PATTERN=$OPTARG
       ;;
    s) SERVER=$OPTARG
       ;;
  esac
done
shift $((OPTIND -1))

(( DAYS_TOTAL = $DAYS - $EXTRA_DAYS ))

generate_post_data()
{
  cat <<EOF
{
  "filtertype":"age",
  "source":"creation_date",
  "direction":"older",
  "unit":"days",
  "unit_count":"$DAYS_TOTAL"
},
{
  "filtertype":"pattern",
  "kind":"prefix",
  "value":"$PATTERN"
}
EOF
}

/usr/local/bin/curator_cli \
  --loglevel INFO \
  --logfile /var/log/curator.log \
  --host $SERVER \
  delete_indices \
  --filter_list "[$(generate_post_data)]"

```

Hope that helps. I do not need authentication or anything like that so it is pretty straight forward...

---

<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:** [April 24, 2019, 2:16pm UTC](https://discuss.elastic.co/t/curator-cli-indices-and-a-new-server-to-me/174138/3 "2019-04-24T14:16:40Z")

</div>

Closed on April 24, 2019, 2:16pm UTC

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