Hello,
Is it possible to define a monthly rolling period policy with Curator ?
I'm using daily indices with the following pattern metrics_%{YYYY.MM.dd}. Today index is metrics_2018.08.06.
What I want is to keep 1 month of metrics (no matter how many days there's in the previous month).
As far as I know, Curator is truncating the date to the most recent whole unit.
Consider the following actions.yml:
0:
action: delete_indices
description : DELETE INDICES metrics daily
options:
ignore_empty_list: True
filters:
- kind: regex
filtertype: pattern
value: ^metrics_\d{4}\.\d{2}\.\d{2}$
- filtertype: period
source: name
timestring: '%Y.%m.%d'
range_from: -1
range_to: 0
unit: months
exclude: True
If I'm running the command today, Curator will subtract a month (2018/05/08) then truncate/round the date (2018/05/01). Since I'm using exclude: True, every index older than 2018/05/01 will be removed.
In my case, I want to remove indices that are older than 2018/05/08.
Of course I can use unit: days but in this case I will have to use either 29, 30 or 31 days depending on how many days there's in the previous month.
Maybe we should add an option to control if we want to truncate/round the date or not ?
Does it make sense ?
Thanks,
Guillaume
I'm using Curator 5.4.1:
$ curator --version
curator, version 5.4.1