枚举处理器插件
此插件允许根据配置的枚举映射字段或标签值。主要用例是将数值重写为人类可读值或反之。可以配置默认映射以用于所有剩余值。
引入版本: Telegraf v1.8.0 标签: transformation 操作系统支持: all
全局配置选项
插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md。
配置
# Map enum values according to given table.
[[processors.enum]]
[[processors.enum.mapping]]
## Names of the fields to map. Globs accepted.
fields = ["status"]
## Name of the tags to map. Globs accepted.
# tags = ["status"]
## Destination tag or field to be used for the mapped value. By default the
## source tag or field is used, overwriting the original value.
dest = "status_code"
## Default value to be used for all values not contained in the mapping
## table. When unset and no match is found, the original field will remain
## unmodified and the destination tag or field will not be created.
# default = 0
## Table of mappings
[processors.enum.mapping.value_mappings]
green = 1
amber = 2
red = 3示例
- xyzzy status="green" 1502489900000000000
+ xyzzy status="green",status_code=1i 1502489900000000000
未知值且未设置默认值
- xyzzy status="black" 1502489900000000000
+ xyzzy status="black" 1502489900000000000
此页面是否有帮助?
感谢您的反馈!
支持和反馈
感谢您成为我们社区的一员!我们欢迎并鼓励您对 Telegraf 和本文档提出反馈和 bug 报告。要获取支持,请使用以下资源
具有年度合同或支持合同的客户可以 联系 InfluxData 支持。