0

我试图在弹性搜索索引中设置自定义 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-000001metricbeat-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']
4

1 回答 1

0

索引模式metricbeat-7.8.0-2021.03.11-000001表明 metricbeat 正在使用翻转索引。它附有创建索引的日期和递增的数字。这也意味着您可能将 ILM 政策附加到您的展期指数。因此,您应该阅读文档中有关ILMCurator的信息。要更正这些被过滤的索引,您必须在配置中allow_ilm_indices: true添加options

于 2021-03-16T15:46:26.857 回答