Logparser Plugin for multiple files

telegraf
#1

Hello, I want to parse multiple files with different patterns using the logparser input plugin from telegraf.

What a i want to do is put into my telegraf configuration file somethin like this:

[[inputs.logparser]]
files = [’/pgdata96/pglog/postgresql-*.log’]
from_beginning = false
[inputs.logparser.grok]
patterns = [‘pattern 1 here’]

[[inputs.logparser]]
files = [’/pgdata96/pglog/archive-*.log’]
from_beginning = false
[inputs.logparser.grok]
patterns = [‘pattern 2 here’]

But Telegraf is not able to do something like this, is there any way to parse multiples files with different patterns from a single telegraf configuration file?

thanks!

#2

Your example configuration above should work, you can define a plugin as many times as you need.