mirror of
https://github.com/dj-wasabi/ansible-telegraf.git
synced 2025-07-17 08:46:37 +00:00
Support for sub_inputs in extra plugins (#184)
Co-authored-by: Michał Lisowski <mlisowski@sentient.ie>
This commit is contained in:
25
README.md
25
README.md
@ -289,6 +289,7 @@ Telegraf plugin options:
|
|||||||
* `interval`: How often to gather this metric. Normal plugins use a single global interval, but if one particular plugin should be run less or more often, you can configure that here.
|
* `interval`: How often to gather this metric. Normal plugins use a single global interval, but if one particular plugin should be run less or more often, you can configure that here.
|
||||||
* `filter.name`: Like when there is an extra filter that needs to be configured, like `grok` for a `logparser` plugin.
|
* `filter.name`: Like when there is an extra filter that needs to be configured, like `grok` for a `logparser` plugin.
|
||||||
* `filter.config`: The extra configuration for the - in the `filter.name` example - `grok` filter. (See example below)
|
* `filter.config`: The extra configuration for the - in the `filter.name` example - `grok` filter. (See example below)
|
||||||
|
* `sub_inputs`: If the input requires other sub inputs, you can add them here (see example below).
|
||||||
|
|
||||||
An example might look like this:
|
An example might look like this:
|
||||||
|
|
||||||
@ -325,6 +326,30 @@ When you want to make use of the `grok` filter for the logparser:
|
|||||||
config:
|
config:
|
||||||
- patterns = ["invoked oom-killer"]
|
- patterns = ["invoked oom-killer"]
|
||||||
|
|
||||||
|
When you want to include a sub inputs with their own configuration:
|
||||||
|
```yaml
|
||||||
|
sqs:
|
||||||
|
plugin: cloudwatch
|
||||||
|
config:
|
||||||
|
- region = "eu-west-1"
|
||||||
|
- access_key = "foo"
|
||||||
|
- secret_key = "bar"
|
||||||
|
- period = "1m"
|
||||||
|
- delay = "2m"
|
||||||
|
- interval = "1m"
|
||||||
|
- namespace = "AWS/SQS"
|
||||||
|
- statistic_include = ["average"]
|
||||||
|
sub_inputs:
|
||||||
|
metrics:
|
||||||
|
- names = [
|
||||||
|
"ApproximateAgeOfOldestMessage",
|
||||||
|
"ApproximateNumberOfMessagesVisible",
|
||||||
|
]
|
||||||
|
metrics.dimensions:
|
||||||
|
- name = "QueueName"
|
||||||
|
- value = "*"
|
||||||
|
```
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
No dependencies
|
No dependencies
|
||||||
|
@ -55,3 +55,11 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if item.value.sub_inputs is defined and item.value.sub_inputs is iterable %}
|
||||||
|
{% for sub_input, config in item.value.sub_inputs.items() %}
|
||||||
|
[[inputs.{{ item.value.plugin | default(item.key) }}.{{ sub_input }}]]
|
||||||
|
{% for items in config %}
|
||||||
|
{{ items }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
Reference in New Issue
Block a user