【问题标题】:Metricbeat creating huge number of fieldsMetricbeat 创建大量字段
【发布时间】:2018-04-05 20:49:08
【问题描述】:

我在 unix 服务器上安装了 metricbeat,它的映射会生成大量字段。如果有办法禁用它们?我想要一个默认索引来仅为 unix“系统”模块映射和 windows“windows”模块映射创建映射。

在我的 yml 中,我只显示类似这样的内容

metricbeat.modules:
- module: system
  period: 1m
  metricsets:
    - cpu
    - load
    - memory
    #- network
    - process
    - process_summary
    #- core
    #- diskio
    #- socket
  processes: ['.*']

- module: system
  period: 10m
  metricsets:
    - filesystem
    - fsstat
  processors:
  - drop_event.when.regexp:
      system.filesystem.mount_point: '^/(sys|cgroup|proc|dev|etc|host|lib)($|/)'

- module: system
  period: 15m
  metricsets:
    - uptime

谢谢。

【问题讨论】:

    标签: elasticsearch metricbeat


    【解决方案1】:

    默认情况下,如果启用了 Elasticsearch 输出,Metricbeat 会自动加载推荐的模板文件 fields.yml。因此,为了自定义您的字段,编写一个包含所有必需字段的 NewFieldsFile.yml 文件,并将 metricbeat.yml 配置文件中的默认设置更改为:

    setup.template.name: "your_template_name"
    setup.template.fields: "path/to/NewFieldsFile.yml"
    

    按照这个官方文档,它包含确切的答案,我希望它会帮助你: https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-template.html

    【讨论】:

      【解决方案2】:

      您可以自定义模块和字段。

      有一些特定的文件称为fields.yml(一个全局文件,每个指标集一个),你必须摆弄它。

      详情请参考文档:

      https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-metricbeat.html

      https://www.elastic.co/guide/en/beats/metricbeat/5.2/creating-metricbeat-module.html#_fields_yml_2

      【讨论】:

      • 是的,这是我的第一个想法,我必须从 yml 字段中删除块以删除映射。我希望关闭和打开 metricbeat.yml 文件中的模块,它不会尝试安装映射。谢谢。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-02-25
      • 2012-12-24
      • 1970-01-01
      • 2012-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多