# Error with curator delete\_index

**URL:** https://discuss.elastic.co/t/error-with-curator-delete-index/97207
**Category:** Elasticsearch
**Created:** [August 16, 2017, 8:17am UTC](https://discuss.elastic.co/t/error-with-curator-delete-index/97207 "2017-08-16T08:17:55Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![legolas\_bilbao](https://avatars.discourse-cdn.com/v4/letter/l/3da27b/32.png) [@legolas\_bilbao](https://discuss.elastic.co/u/legolas_bilbao)
#### Post date: [August 16, 2017, 8:17am UTC](https://discuss.elastic.co/t/error-with-curator-delete-index/97207/1 "2017-08-16T08:17:55Z")

</div>

Good morning,

I wanna delete the older index from kibana and I wanna user curator.

First , I've get the index that I've in kibana

```
curl -XGET 'localhost:9200/_cat/indices?v&pretty'
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open twitter-traffic vFCR7_41QHyKgI0J8oPkbw 5 1 9924 0 51mb 51mb
yellow open pan-traffic 1dIt-MZbTmeARb-a5YAsSQ 5 1 139262798 0 112.6gb 112.6gb
yellow open .kibana KOgWNAvPQ467H1d8s7-wlg 1 1 47 2 149.1kb 149.1kb

```

My action file is the following

```
---
actions:
  1:
    action: delete_indices
    description: >-
      Delete indices older than 45 days (based on index name), for pan-traffic
      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: pan-traffic,twitter-traffic
      exclude:
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 45

The config file

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

```

the execution of the following command is the following

2017-08-16 10:10:37,488 INFO Preparing Action ID: 1, "delete\_indices"  
2017-08-16 10:10:37,503 INFO Trying Action ID: 1, "delete\_indices": Delete indices older than 45 days (based on index name), for pan-traffic prefixed indices. Ignore the error if the filter does not result in an actionable list of indices (ignore\_empty\_list) and exit cleanly.  
2017-08-16 10:10:37,569 INFO Skipping action "delete\_indices" due to empty list: \<class 'curator.exceptions.NoIndices'\>  
2017-08-16 10:10:37,569 INFO Action ID: 1, "delete\_indices" completed.  
2017-08-16 10:10:37,569 INFO Job completed.

any ideas whats wrong?

kindly regards

---

<div class="post-metadata">

### Author: ![Shaoranlaos](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Shaoranlaos](https://discuss.elastic.co/u/Shaoranlaos)
#### Post date: [August 16, 2017, 8:58am UTC](https://discuss.elastic.co/t/error-with-curator-delete-index/97207/2 "2017-08-16T08:58:25Z")

</div>

your age filter is wrongly configured

in your cofiguration it looks for a timstamp in the name of the index which you have none

you will have to use creation\_date based age filter through setting source to "creation\_date" and removing timestring

or you could use field\_stats based filtering which would filter all indices in which the newest event is past the configured age

- filtertype: age  
source: field\_stats  
direction: older  
unit: days  
unit\_count: 3  
field: '@timestamp'  
stats\_result: max\_value

For reference: [https://www.elastic.co/guide/en/elasticsearch/client/curator/current/filtertype\_age.html](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/filtertype_age.html)

principal question is why you would like to delete older indices if your indices are not timebased created?

---

<div class="post-metadata">

### Author: ![legolas\_bilbao](https://avatars.discourse-cdn.com/v4/letter/l/3da27b/32.png) [@legolas\_bilbao](https://discuss.elastic.co/u/legolas_bilbao)
#### Post date: [August 16, 2017, 9:27am UTC](https://discuss.elastic.co/t/error-with-curator-delete-index/97207/3 "2017-08-16T09:27:05Z")

</div>

> [@Shaoranlaos](#):
>
> a timstamp in the na

Hi, all the index are timestamp based:

```
actions:
  1:
    action: delete_indices
    description: >-
      Delete indices older than 45 days (based on index name), for pan-traffic
      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: pan-traffic
    - filtertype: age
      source: field_stats
      direction: older
      unit: days
      unit_count: 45
      field: '@timestamp'
      stats_result: max_value

```

Then if I remove the

> ```
> - filtertype: pattern
> kind: prefix
> value: pan-traffic
> 
> ```

It's works except with the following command Failed to complete action: delete\_indices. \<class 'curator.exceptions.ActionError'\>: Field "@timestamp" not found in index ".kibana"

How can i exlude this index?

---

<div class="post-metadata">

### Author: ![Shaoranlaos](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Shaoranlaos](https://discuss.elastic.co/u/Shaoranlaos)
#### Post date: [August 16, 2017, 9:42am UTC](https://discuss.elastic.co/t/error-with-curator-delete-index/97207/4 "2017-08-16T09:42:22Z")

</div>

You could add a second filter pattern that excludes the .kibana index like

- filtertype: pattern

![](https://us1.discourse-cdn.com/elastic/original/2X/2/2485d26919316b1d80aa60f5ca8e2cb5bc0275fe.jpg)

![](https://us1.discourse-cdn.com/elastic/original/3X/5/2/52e3d8429dc9df354e80745a95a85b3abf8eb09e.jpg)

---

<div class="post-metadata">

### Author: ![legolas\_bilbao](https://avatars.discourse-cdn.com/v4/letter/l/3da27b/32.png) [@legolas\_bilbao](https://discuss.elastic.co/u/legolas_bilbao)
#### Post date: [August 16, 2017, 9:54am UTC](https://discuss.elastic.co/t/error-with-curator-delete-index/97207/5 "2017-08-16T09:54:06Z")

</div>

Many thanks

I'm doing in other way

- filtertype: kibana  
exclude: True

---

<div class="post-metadata">

### Author: ![Shaoranlaos](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Shaoranlaos](https://discuss.elastic.co/u/Shaoranlaos)
#### Post date: [August 16, 2017, 10:02am UTC](https://discuss.elastic.co/t/error-with-curator-delete-index/97207/6 "2017-08-16T10:02:11Z")

</div>

yeh i hadn't thought of that filter it is realy the better way because it not only excludes .kibana but also some other meta indices

could you mark a solution?

---

<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: [September 13, 2017, 10:02am UTC](https://discuss.elastic.co/t/error-with-curator-delete-index/97207/7 "2017-09-13T10:02:13Z")

</div>

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