首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在metricbeat索引中设置正确的时间串?

如何在metricbeat索引中设置正确的时间串?
EN

Stack Overflow用户
提问于 2021-03-12 05:32:26
回答 1查看 108关注 0票数 0

我试图在elasticsearch索引中设置一个自定义的metricbeat索引。

当我将如下所示添加到metricbeat.yml文件时

代码语言:javascript
复制
        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的索引

我甚至试过这样

代码语言:javascript
复制
        index: "metricbeat-{now/d}"
      setup.template:
        name: "metricbeat"
        pattern: "metricbeat-{now/d}"

但是相同的索引模式。请帮帮忙。

更新:

策展人配置

代码语言:javascript
复制
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']
EN

回答 1

Stack Overflow用户

发布于 2021-03-16 23:46:27

索引模式metricbeat-7.8.0-2021.03.11-000001表示metricbeat正在使用翻转索引。它附加了索引创建时的日期和递增的数字。这也意味着您可能有一个ILM策略附加到您的转存索引。因此,您应该阅读文档中有关ILM Curator的内容。要纠正这些被过滤的索引,您必须在您的配置中向options添加allow_ilm_indices: true

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66590850

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档