Elasticsearch index and curator

(Romain Pelissier) #1

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

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:

    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.
      ignore_empty_list: True
      continue_if_exception: False
      disable_action: False
    - filtertype: pattern
      kind: prefix
      value: '^(logstash-).*$'
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 7

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.. :slight_smile:
Thanks for your comments!

(Aaron Mildenstein) #2

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.

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:

  - 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.

(Romain Pelissier) #3


(system) #4

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