# Elasticsearch index and curator

**URL:** <https://discuss.elastic.co/t/elasticsearch-index-and-curator/121389>\
**Category:** Elasticsearch\
**Created:** [February 25, 2018, 2:59pm UTC](https://discuss.elastic.co/t/elasticsearch-index-and-curator/121389 "2018-02-25T14:59:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Romain\_Pelissier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/romain_pelissier/32/19806_2.png) [@Romain\_Pelissier](https://discuss.elastic.co/u/Romain_Pelissier)\
**Post date:** [February 25, 2018, 2:59pm UTC](https://discuss.elastic.co/t/elasticsearch-index-and-curator/121389/1 "2018-02-25T14:59:57Z")

</div>

Hi all!  
I got a newbie question for you 🙂  
Right now, I have configured my logstash destination to my elastic only node like this:  
ex:

```
if [type] == "syslog" {
        elasticsearch {
        hosts => localhost
        index => "logstash-%{+YYYY.MM.dd}" }
        }

```

So if I understand correctly, this will create a new index everyday, am I right?  
Also, I have a curator script running that should clean the data older than 30 days:

```
---
actions:
  1:
    action: delete_indices
    description: >-
      Delete indices older than 45 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: 7
      exclude:

```

But I am not sure that I am doing this the right way since if I check the status of my elastic node, some shards (using cerebro) some shards do not seems to be assigned...

So should I create my index like "name-of-the-index" instead of "name-of-the-index-%{+YYYY.MM.dd}"?

Is my curator script will work anyway? Do my shards will be assigned this time?

I know,,. plenty of question.. 🙂  
Thanks for your comments!

---

<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 26, 2018, 10:08pm UTC](https://discuss.elastic.co/t/elasticsearch-index-and-curator/121389/2 "2018-02-26T22:08:44Z")

</div>

Unassigned shards is a different matter. You mention an _elastic node_ as a single entity. If you only have a single node, then you will see unassigned shards by default, as there will be no other node on which to allocate replica shards.

> [@Romain\_Pelissier](#):
>
> ```auto
> filters:
> - filtertype: pattern
> kind: prefix
> value: '^(logstash-).*$'
> exclude:
> 
> ```

This is overkill. The `prefix` filtertype already takes whatever `value` you provide and translates it into a regex like `^VALUE.*$` So you can do this:

```auto
filters:
  - filtertype: pattern
    kind: prefix
    value: logstash-

```

Also note that empty values will just take the default, so you don't need the `exclude:` line.

Other than that, it looks good.

---

<div class="post-metadata">

**Author:** ![Romain\_Pelissier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/romain_pelissier/32/19806_2.png) [@Romain\_Pelissier](https://discuss.elastic.co/u/Romain_Pelissier)\
**Post date:** [February 27, 2018, 10:41pm UTC](https://discuss.elastic.co/t/elasticsearch-index-and-curator/121389/3 "2018-02-27T22:41:23Z")

</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 27, 2018, 10:56pm UTC](https://discuss.elastic.co/t/elasticsearch-index-and-curator/121389/4 "2018-03-27T22:56:05Z")

</div>

Closed on March 27, 2018, 10:56pm UTC

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