> actions:
> 1:
> action: delete_indices
> description: >-
> Delete index's older than X days or when reach disk space 200gb
> options:
> ignore_empty_list: True
> filters:
> - filtertype: pattern
> kind: prefix
> value: logs-
> - filtertype: age
> source: name
> direction: older
> timestring: '%Y.%m.%d'
> unit: days
> unit_count: 60
> - filtertype: space
> disk_space: 400
> use_age: True
> source: field_stats
> field: '@timestamp'
> stats_result: max_value
>
> actions:
> 1:
> action: rollover
> description: >-
> Rollover the index every 1gb.
> options:
> name: logs_write
> conditions:
> max_size: 5g
> max_age: 1d
something wrong with my rollover curator - he cant find logs_Write name aliases
i added to my elastic template this alias.
there is an option via logstash to roll every 5gb or every 1day ? (already got every 1 day)
A Rollover alias should be treated different from other aliases. It will always fail if you have the rollover alias name set to be re-added in the index template.
With the Rollover API, you do not need to do this. It takes care of it for you. You create the alias once at initial index creation time, and then rollover handles it for you.
You can continue to use your custom index template, but it cannot contain an alias section with the logs_write alias. Once created, you never have to touch it again. Rollover takes care of everything for you, but you must call it periodically for the rollover to happen. It's not automatic.
action: rollover
description: >-
Rollover the index every 5gb or 1d.
options:
name: test
conditions:
max_age: 1d
max_docs: 1000000
max_size: 5gb
but i get an error from curator
2019-01-17 08:24:58,847 INFO Preparing Action ID: 2, "rollover"
2019-01-17 08:24:58,863 INFO Trying Action ID: 2, "rollover": Rollover the index every 5gb or 1d.
2019-01-17 08:24:58,863 ERROR Failed to complete action: rollover. <class 'ValueError'>: Unable to perform index rollover with alias "test". See previous logs for more details.
This is almost certainly because logs- is not a viable rollover index. A rollover index name should be a pattern followed by a dash and an incrementable number, like index-000001. When a rollover is called, it will increment that number.
There are exceptions to this rule (e.g. using dates in the name), but even those exceptions ought to end with a dash and a number.
ok , now the rollover via curator work thanks.
its create a new index by the conditions but it still adding docs to the first one.
logstash;
index => "logs-000001"
added aliases via route _aliases with action add.
the new index called logs-000002 but the docs increase to the first index.
It seems likely that your Logstash is shipping to an index name, rather than an alias. For the procedure I shared previously to work, Logstash cannot be shipping to the alias you are creating before it is created, otherwise Logstash will create that alias name as an index name instead.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.