# Delete 3 days older indices from elasticsearch

**URL:** <https://discuss.elastic.co/t/delete-3-days-older-indices-from-elasticsearch/89185>\
**Category:** Elasticsearch\
**Created:** [June 13, 2017, 12:10pm UTC](https://discuss.elastic.co/t/delete-3-days-older-indices-from-elasticsearch/89185 "2017-06-13T12:10:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sachintanpure85](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@sachintanpure85](https://discuss.elastic.co/u/sachintanpure85)\
**Post date:** [June 13, 2017, 12:10pm UTC](https://discuss.elastic.co/t/delete-3-days-older-indices-from-elasticsearch/89185/1 "2017-06-13T12:10:19Z")

</div>

Hi.

I want to delete the 5 days older indices from elasticsearch. I have gone through the some elastic community links . Found the best way for this on this link: [https://stackoverflow.com/questions/33430055/removing-old-indices-in-elasticsearch/42268400#42268400](https://stackoverflow.com/questions/33430055/removing-old-indices-in-elasticsearch/42268400#42268400)

So downloaded curator for windows from :[https://www.elastic.co/guide/en/elasticsearch/client/curator/4.2/windows-zip.html](https://www.elastic.co/guide/en/elasticsearch/client/curator/4.2/windows-zip.html)

After this : I have created the config.yml and action.yml file as follows:

client:  
hosts: ["127.0.0.1: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: "/root/curator/logs/actions.log"  
logformat: default  
blacklist: ['elasticsearch', 'urllib3']

actions:  
1:  
action: delete\_indices  
description: \>-  
Delete indices older than 3 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: pattern  
kind: prefix  
value: logstash-  
exclude:  
- filtertype: age  
source: name  
direction: older  
timestring: '%Y.%m.%d'  
unit: days  
unit\_count: 3  
exclude:

```
  actions:

```

And I am running the command : $ curater --config C:/ElasticSearch/curator-4.2.6-win32/config.yml C:/ElasticSearch/curator-4.2.6-win32/action.yml

But it gives me the error : bash: curater: command not found

---

<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 13, 2017, 12:57pm UTC](https://discuss.elastic.co/t/delete-3-days-older-indices-from-elasticsearch/89185/2 "2017-06-13T12:57:16Z")

</div>

It's spelled `curator`, rather than `curater`

---

<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 13, 2017, 12:59pm UTC](https://discuss.elastic.co/t/delete-3-days-older-indices-from-elasticsearch/89185/3 "2017-06-13T12:59:31Z")

</div>

Additionally, if you installed Curator for windows, it won't be runnable in Bash for Windows, but rather in 'CMD` or Powershell

---

<div class="post-metadata">

**Author:** ![sachintanpure85](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@sachintanpure85](https://discuss.elastic.co/u/sachintanpure85)\
**Post date:** [June 13, 2017, 12:59pm UTC](https://discuss.elastic.co/t/delete-3-days-older-indices-from-elasticsearch/89185/4 "2017-06-13T12:59:59Z")

</div>

Sorry for the typo but still the same error : $ curator --config C:/ElasticSearch/curator-4.2.6-win32/config.yml C:/ElasticSearch/curator-4.2.6-win32/action.yml  
bash: curator: command not found

---

<div class="post-metadata">

**Author:** ![sachintanpure85](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@sachintanpure85](https://discuss.elastic.co/u/sachintanpure85)\
**Post date:** [June 13, 2017, 1:04pm UTC](https://discuss.elastic.co/t/delete-3-days-older-indices-from-elasticsearch/89185/5 "2017-06-13T13:04:26Z")

</div>

I can not run the cmd on my machine ,I don't have access . so I am using the bash cmd . The ElasticSearch , kibana and logstash are working fine on my machine . How can I run the curator in the same way , I am running Eelastic and all?

---

<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 13, 2017, 1:17pm UTC](https://discuss.elastic.co/t/delete-3-days-older-indices-from-elasticsearch/89185/6 "2017-06-13T13:17:15Z")

</div>

You would need to install the DEB version there, or install Python inside Bash for windows, and install via pip there.

---

<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:** [July 11, 2017, 1:17pm UTC](https://discuss.elastic.co/t/delete-3-days-older-indices-from-elasticsearch/89185/7 "2017-07-11T13:17:15Z")

</div>

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