close索引配置文件示例
关闭30天前以dtlog为前缀的索引:
---
actions:
1:
action: close
description: >-
Close indices older than 30 days (based on index name), for dtlog-
prefixed indices.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
filters:
- filtertype: pattern
kind: regex
value: '^dtlog-'
exclude:
- filtertype: pattern
kind: regex
value: '^(?!.*message).*$' 匹配不包含message的行
exclude:
- filtertype: pattern
kind: regex
value: '^(?!dtlog-1-jhyt).*$' 匹配不以dtlog-1-jhyt开头的行
exclude:
##fliter默认以AND逻辑连接,若要匹配多个,可以使用|在同一个正则表达式中表示OR逻辑
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 30
exclude:
timeout_override
filtertype_pattern
filtertype_age
open索引配置文件示例
actions:
1:
action: open
description: "open selected indices"
options:
continue_if_exception: False
timeout_override: 300
filters:
- filtertype: pattern
kind: regex
value: '^dtlog-1.*2019.04'