1

我已经将 logstash 设置为发送到 Kibana,它使用两个自定义字段标记每个日志文件——集群和节点: 在此处输入图像描述

我想使用“字段”选项将相同的两个字段添加到我的 Metricbeat 配置中,但是当我这样做时,它会作为 Kibana 中的字典出现: 在此处输入图像描述

这是我正在使用的 Metricbeat 配置文件:

metricbeat.modules:
- module: system
  metricsets:
    # CPU stats
    - cpu

    # System Load stats
    - load

    # Per CPU core stats
    #- core

    # IO stats
    #- diskio

    # Per filesystem stats
    - filesystem

    # File system summary stats
    - fsstat

    # Memory stats
    - memory

    # Network stats
    - network

    # Per process stats
    - process

    # Sockets (linux only)
    #- socket
  enabled: true
  period: 10s
  processes: ['.*']

  #Add Supervisor Cluster and Node ID
  fields:
    cluster: "Upswell ELK Testing Cluster"
    node: "Nina's Macbook"

#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:

  # Array of hosts to connect to.
  hosts: ["http://localhost:9200"]

我找不到任何关于如何格式化这些字段的文档;这是我应该在 Logstash 或 Metricbeat 配置中进行的调整吗?

4

1 回答 1

3

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

fields :默认情况下,您在此处指定的字段将分组在输出文档中的字段子字典下。要将自定义字段存储为顶级字段,请将fields_under_root选项设置为true

于 2017-06-30T14:51:52.400 回答