docs(outputs.mqtt): Add reference to sprig (#16490)

This commit is contained in:
Pieter Slabbert 2025-02-13 17:07:09 +02:00 committed by GitHub
parent 682d774d17
commit 1b6350ac9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -55,8 +55,9 @@ to use them.
## {{ .TopicPrefix }}/{{ .Hostname }}/{{ .PluginName }}/{{ .Tag "tag_key" }}
## (e.g. prefix/web01.example.com/mem/some_tag_value)
## Each path segment accepts either a template placeholder, an environment variable, or a tag key
## of the form `{{.Tag "tag_key_name"}}`. Empty path elements as well as special MQTT characters
## (such as `+` or `#`) are invalid to form the topic name and will lead to an error.
## of the form `{{.Tag "tag_key_name"}}`. All the functions provided by the Sprig library
## (http://masterminds.github.io/sprig/) are available. Empty path elements as well as special MQTT
## characters (such as `+` or `#`) are invalid to form the topic name and will lead to an error.
## In case a tag is missing in the metric, that path segment omitted for the final topic.
topic = "telegraf/{{ .Hostname }}/{{ .PluginName }}"

View File

@ -16,8 +16,9 @@
## {{ .TopicPrefix }}/{{ .Hostname }}/{{ .PluginName }}/{{ .Tag "tag_key" }}
## (e.g. prefix/web01.example.com/mem/some_tag_value)
## Each path segment accepts either a template placeholder, an environment variable, or a tag key
## of the form `{{.Tag "tag_key_name"}}`. Empty path elements as well as special MQTT characters
## (such as `+` or `#`) are invalid to form the topic name and will lead to an error.
## of the form `{{.Tag "tag_key_name"}}`. All the functions provided by the Sprig library
## (http://masterminds.github.io/sprig/) are available. Empty path elements as well as special MQTT
## characters (such as `+` or `#`) are invalid to form the topic name and will lead to an error.
## In case a tag is missing in the metric, that path segment omitted for the final topic.
topic = "telegraf/{{ .Hostname }}/{{ .PluginName }}"