Add template processor (#6494)
This commit is contained in:
26
plugins/processors/template/README.md
Normal file
26
plugins/processors/template/README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Template Processor
|
||||
|
||||
The `template` processor applies a go template to tag, field, measurement and time values to create a new tag.
|
||||
|
||||
Golang [Template Documentation]
|
||||
|
||||
### Configuration
|
||||
|
||||
```toml
|
||||
# Concatenate two tags to create a new tag
|
||||
[[processors.template]]
|
||||
## Tag to create
|
||||
tag = "topic"
|
||||
## Template to create tag
|
||||
# Note: Single quotes (') are used, so the double quotes (") don't need escaping (\")
|
||||
template = '{{ .Tag "hostname" }}.{{ .Tag "level" }}'
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
```diff
|
||||
- cpu,level=debug,hostname=localhost value=42i
|
||||
+ cpu,level=debug,hostname=localhost,topic=localhost.debug value=42i
|
||||
```
|
||||
|
||||
[Template Documentation]:https://golang.org/pkg/text/template/
|
||||
Reference in New Issue
Block a user