Logfmt 输入数据格式
使用 logfmt
数据格式来解析 logfmt 数据到 Telegraf 指标。
配置
[[inputs.file]]
files = ["example"]
## 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 = "logfmt"
## Array of key names which should be collected as tags. Globs accepted.
logfmt_tag_keys = ["method","host"]
指标
行中的每个键/值对都作为字段添加到新的指标中。字段的类型根据值的内容自动确定。
示例
- method=GET host=example.org ts=2018-07-24T19:43:40.275Z connect=4ms service=8ms status=200 bytes=1653
+ logfmt,host=example.org,method=GET ts="2018-07-24T19:43:40.275Z",connect="4ms",service="8ms",status=200i,bytes=1653i
此页对您有帮助吗?
感谢您的反馈!