I'm trying to use curator python API to periodically delete old logs in elasticsearch. In my code output, it seems I can't filter the indices I want which stuck me several days. Anyone can help to have a look if I have done anything wrong? I used elasticsearch-curator version 5.4.1 and tested elasticsearch 5.5 on EC2, aws elasticsearch 5.5 and aws elasticsearch 6.0 and the results are the same.
Following is my code:
from elasticsearch import Elasticsearch
import elasticsearch
import curator
def handler():
client = elasticsearch.Elasticsearch(['http://XX.153.17.133:9200'])
ilo = curator.IndexList(client)
print ilo.all_indices
print ilo.filter_by_regex(kind='prefix', value='mov')
print ilo.filter_by_age(source='creation_date', direction='older', unit='seconds', unit_count=2)
#delete_indices = curator.DeleteIndices(ilo)
#delete_indices.do_action()
return
handler()
And following is the output:
/Users/junyu/PycharmProjects/es-curator/bin/python
/Users/junyu/PycharmProjects/es-curator/es-curator.py
[u'movie']
None
None
Process finished with exit code 0
Thank you in advance!