# Delete Indices with Curator correct timestring format

**URL:** https://discuss.elastic.co/t/delete-indices-with-curator-correct-timestring-format/168171
**Category:** Elasticsearch
**Created:** [February 13, 2019, 9:30am UTC](https://discuss.elastic.co/t/delete-indices-with-curator-correct-timestring-format/168171 "2019-02-13T09:30:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![aleksei.saiko](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@aleksei.saiko](https://discuss.elastic.co/u/aleksei.saiko)
#### Post date: [February 13, 2019, 9:30am UTC](https://discuss.elastic.co/t/delete-indices-with-curator-correct-timestring-format/168171/1 "2019-02-13T09:30:04Z")

</div>

Hello!  
I'm trying to delete with Curator Indices that are older than X time.  
Seems like after running curator, it doesn't really work, because I still can see older Indices when running curl -X GET "localhost:9200/\_cat/indices?v" command.

My Index format from Logstash conf file -

```auto
index => "apps-prod-dal10-%{[kubernetes][namespace]}-deployment-%{[kubernetes][pod][name]}-%{[kubernetes][labels][app]}-%{[kubernetes][container][name]}-%{+YYYY.MM.dd}"

```

And my curator action file is

```auto
---
actions:
 1:
   action: delete_indices
   description: >-
     Delete indices older then 14 days.
   options:
     ignore_empty_list: True
     disable_action: True
   filters:
   - filtertype: pattern
     kind: prefix
     value: apps-
   - filtertype: age
     source: name
     direction: older
     timestring: '%YYYY.%MM.%dd'
     unit: days
     unit_count: 14

```

Maybe it's related to timestring format? What it should be like with this kind of Index?

Thanks,

Aleksei

---

<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: [February 13, 2019, 12:21pm UTC](https://discuss.elastic.co/t/delete-indices-with-curator-correct-timestring-format/168171/2 "2019-02-13T12:21:56Z")

</div>

That timestring is using Logstash format. The [Curator timestring] uses a python format. For `Year.Month.Day` in Curator, it is `%Y.%m.%d`

---

<div class="post-metadata">

### Author: ![aleksei.saiko](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@aleksei.saiko](https://discuss.elastic.co/u/aleksei.saiko)
#### Post date: [February 13, 2019, 1:47pm UTC](https://discuss.elastic.co/t/delete-indices-with-curator-correct-timestring-format/168171/3 "2019-02-13T13:47:06Z")

</div>

Thanks

---

<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 13, 2019, 1:47pm UTC](https://discuss.elastic.co/t/delete-indices-with-curator-correct-timestring-format/168171/4 "2019-03-13T13:47:13Z")

</div>

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