首页 > 解决方案 > 在 Metricbeat 中设置 beat.hostname

问题描述

我对这些概念非常陌生,如果这是一件愚蠢的事情,我深表歉意。我正在尝试使用 Elasticsearch 数据源在 Grafana 上可视化 Metricbeat 数据,所有这些数据都在本地运行,但无法找到在 Metricbeat 配置中添加“beat.hostname”的位置。

我拥有 Grafana 和 Metricbeat 的最新版本,并且正在关注这篇文章。在“创建仪表板”部分,作者提到他在安装 Metricbeat 时使用了“beat.hostname=grafana”作为主机名。然后,他在查询编辑器字段中使用它来提取 Grafana 仪表板上的数据。

但是我们在哪里设置呢?我查看了 Metricbeat 文件夹中的两个 YAML 文件,但没有任何描述。

非常感谢你的帮助!

标签: elasticsearchgrafanametricbeat

解决方案


我认为您只需在 metricbeat.yml 中引用“名称”变量

# ================================== General ===================================

# The name of the shipper that publishes the network data. It can be used to group
# all the transactions sent by a single shipper in the web interface.
name: "jeremy-laptop"

# The tags of the shipper are included in their own field with each
# transaction published.
tags: ["laptop", "ubuntu"]

你会发现这个值为“ host.name ”并能够对其进行过滤。

在此处输入图像描述

我不是 Grafana 的真正用户,所以这部分会站在你这边


推荐阅读