2

我在 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

谢谢。

4

2 回答 2

2

默认情况下,如果启用了 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

于 2018-09-20T08:58:06.723 回答
0

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

有一些特定的文件被称为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

于 2018-04-11T08:38:35.960 回答