文档文档

Telegraf 输入数据格式

Telegraf 的 输入插件 以一种或多种数据格式消费数据,并将数据解析成 Telegraf 的 [指标][/telegraf/v1/metrics/]。许多输入插件都使用可配置的解析器来将数据格式解析成指标。这使得像 kafka_consumer 输入插件 这样的输入插件能够消费和处理不同的数据格式,例如 InfluxDB 行协议或 JSON。Telegraf 支持以下输入数据格式

任何包含 data_format 选项的输入插件都可以使用它来选择所需的解析器。

[[inputs.exec]]
  ## Commands array
  commands = ["/tmp/test.sh", "/usr/bin/mycollector --foo=bar"]

  ## measurement name suffix (for separating different commands)
  name_suffix = "_mycollector"

  ## Data format to consume.
  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
  data_format = "json_v2"

输入解析器插件

当您在支持的 输入插件 配置中指定 data_format 时,该输入插件会使用关联的 解析器插件 将数据从其源格式转换为 Telegraf 指标。许多解析器插件提供了额外的配置选项,用于指定数据模式的详细信息以及它应如何映射到 Telegraf 指标的字段。


此页面是否有帮助?

感谢您的反馈!


InfluxDB 3.8 新特性

InfluxDB 3.8 和 InfluxDB 3 Explorer 1.6 的主要增强功能。

查看博客文章

InfluxDB 3.8 现已适用于 Core 和 Enterprise 版本,同时发布了 InfluxDB 3 Explorer UI 的 1.6 版本。本次发布着重于操作成熟度,以及如何更轻松地部署、管理和可靠地运行 InfluxDB。

更多信息,请查看

InfluxDB Docker 的 latest 标签将指向 InfluxDB 3 Core

在 **2026 年 2 月 3 日**,InfluxDB Docker 镜像的 latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。

如果使用 Docker 来安装和运行 InfluxDB,latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。例如,如果使用 Docker 运行 InfluxDB v2,请将 latest 版本标签替换为 Docker pull 命令中的特定版本标签 — 例如

docker pull influxdb:2