在我们公司的标准 elasticsearch 和 curator 实现之上,我们有一个自定义包装器。我想知道当默认“时间单位”设置为“天”时,策展人处理“每月/每周”索引的行为是什么。
**我无法覆盖默认的“时间单位”
这是我们的每月/每周索引如何命名的示例格式
月度指数格式
logstash-test-monthly-2018.01
logstash-test-monthly-2018.02
logstash-test-monthly-2018.03
logstash-test-monthly-2018.04
...
...
logstash-test-monthly-2018.12
每周索引格式
logstash-test-weekly-2018.01
logstash-test-weekly-2018.02
...
...
...
logstash-test-weekly-2018.51
logstash-test-weekly-2018.52
Delete_Index.yml - 策展人删除指令
actions:
1:
action: delete_indices
options:
ignore_empty_list: true
filters:
- exclude: true
filtertype: kibana
- exclude: false
kind: regex
filtertype: pattern
value: .*-monthly-.*
- range_to: 0
filtertype: period
source: name
range_from: -60
period_type: relative
timestring: '%Y.%m.%d'
exclude: true
unit: days
description: Delete indices more than X days old
2:
action: delete_indices
options:
ignore_empty_list: true
filters:
- exclude: true
filtertype: kibana
- exclude: false
kind: regex
filtertype: pattern
value: .*-weekly-.*
- range_to: 0
filtertype: period
source: name
range_from: -30
period_type: relative
timestring: '%Y.%m.%d'
exclude: true
unit: days
实施上述配置,每月索引保留时间为 60 天,每周索引保留时间为 30 天。
该配置于 **2018 年 4 月 4 日执行,结果为**
执行后保留的月度索引
logstash-test-monthly-2018.03
logstash-test-monthly-2018.04
由于上述索引 ^^ 仅包含 31+4=35 天的索引数据,而不是预期的 60 天。
我期待 curator 会保留以下索引
logstash-test-monthly-2018.02
logstash-test-monthly-2018.03
logstash-test-monthly-2018.04
谁能解释为什么馆长无法保留 60 天的索引?