Merge pull request #94 from ph4r5h4d/master

Add processors section in Telegraf config
This commit is contained in:
Werner Dijkerman
2019-03-12 16:25:37 +01:00
committed by GitHub
2 changed files with 25 additions and 1 deletions

View File

@ -233,7 +233,16 @@ An example might look like this:
- fstype = [ "ext4", "xfs" ]
- path = [ "/opt", "/home" ]
If you want to define processors you can simply use `telegraf_processors` variable.
An example might look like this:
```
telegraf_processors:
- processor: rename
- processor: rename.replace
config:
- tag = "level"
- dest = "LogLevel"
```
## Dependencies

View File

@ -112,4 +112,19 @@
# No plugins configured, added a mem plugin so telegraf doesn't stop working.
[[inputs.mem]]
{% endif %}
{% endif %}
###############################################################################
# PROCESSORS #
###############################################################################
{% if telegraf_processors is defined and telegraf_processors is iterable %}
{% for item in telegraf_processors %}
[[processors.{{ item.processor }}]]
{% if item.config is defined and item.config is iterable %}
{% for items in item.config %}
{{ items }}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}