我使用 Elasticsearch + Kibana + File-/Metric-/Winlogbeat 來總結我的記錄檔。為了不讓我的 HDD 充滿大量日誌,我只想將它們保留 14 天 - 所以我安裝了 Curator 來幫我完成這項工作。不幸的是,Curator 沒有刪除任何日誌,因為空列表。我無法弄清楚為什麼 Curator 認為沒有合適的索引可以刪除。
我的 action.yml 看起來像
actions:
1:
action: delete_indices
description: >-
Delete indices older than 30 days (based on index name), for winlogbeat-
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: winlogbeat-
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 14
我的 Winlog 索引的名稱是
winlogbeat-7.5.2-2020.04.01-000033
winlogbeat-7.5.2-2020.04.02-000034
我嘗試了很多方法,但問題仍然存在。
知道什麼可以解決我的問題嗎?
答案1
好吧,對我來說唯一可行的解決方案是手動運行 curator_cli - 儘管它是由 cronjob 完成的。
curator_cli --config /home/user/curator.yml delete_indices --filter_list '[{"filtertype":"age","source":"creation_date","direction":"older","timestring":"%Y.%m.%d","unit":"days","unit_count":7},{"filtertype":"pattern","kind":"prefix","value":"winlogbeat-"}]'