mirror of
https://github.com/dj-wasabi/ansible-telegraf.git
synced 2025-07-17 08:46:37 +00:00
Merge pull request #94 from ph4r5h4d/master
Add processors section in Telegraf config
This commit is contained in:
11
README.md
11
README.md
@ -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
|
||||
|
||||
|
@ -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 %}
|
Reference in New Issue
Block a user