我试图在elasticsearch索引中设置一个自定义的metricbeat索引。
当我将如下所示添加到metricbeat.yml文件时
index: "metricbeat-%{[agent.version]}-%{+yyyy-MM-dd}"
setup.template:
name: "metricbeat"
pattern: "metricbeat-%{[agent.version]}-%{+yyyy-MM-dd}"生成的索引为metricbeat-7.8.0-2021.03.11-000001。但是curator中的时间字符串'%Y.%m.%d'与它不匹配,并且无法清除索引。
如何建立从metricbeat-7.8.0-2021.03.11-000001到metricbeat-7.8.0-2021.03.11的索引
我甚至试过这样
index: "metricbeat-{now/d}"
setup.template:
name: "metricbeat"
pattern: "metricbeat-{now/d}"但是相同的索引模式。请帮帮忙。
更新:
策展人配置
Data
====
action_file.yml:
----
---
actions:
1:
action: delete_indices
description: "Clean up ES by deleting old indices"
options:
timeout_override:
continue_if_exception: False
disable_action: False
ignore_empty_list: True
filters:
- filtertype: pattern
kind: regex
value: '^(metricbeat-).*$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 7
field:
stats_result:
epoch:
exclude: False
config.yml:
----
---
client:
hosts:
- elasticsearch-master.paas.svc
port: 9200
# url_prefix:
# use_ssl: True
# certificate:
# client_cert:
# client_key:
# ssl_no_validate: True
# http_auth:
# timeout: 30
# master_only: False
logging:
loglevel: DEBUG
# logfile:
# logformat: default
# blacklist: ['elasticsearch', 'urllib3']发布于 2021-03-16 23:46:27
索引模式metricbeat-7.8.0-2021.03.11-000001表示metricbeat正在使用翻转索引。它附加了索引创建时的日期和递增的数字。这也意味着您可能有一个ILM策略附加到您的转存索引。因此,您应该阅读文档中有关ILM Curator的内容。要纠正这些被过滤的索引,您必须在您的配置中向options添加allow_ilm_indices: true。
https://stackoverflow.com/questions/66590850
复制相似问题