I'm testing the awesome new logparser plugin but I have trouble to made it work.
Telegraf - version 1.0.0-beta2
Running it on Ubuntu 14.04
[[inputs.logparser]]
files = [ "/var/log/nginx/access.log" ]
[inputs.logparser.grok]
patterns = [ "%{COMMONAPACHELOG} %{QS:referrer} %{QS:agent}" ]
This settings works when I type telegraf in my console but not work when I launch telegraf with service telegraf start
When I launch telegraf in my console I can see the lines
Loaded inputs: cpu disk diskio net nginx logparser mem system
Seeked /var/log/nginx/access.log - &{Offset:0 Whence:2}
But when I launch it from service telegraf start this is the lines in logfile
Loaded inputs: diskio net nginx logparser mem system cpu disk
The line with Seeked is not presents
If I set only the logparser plugin, there is 0 metric gathered.
Maybe this is normal due to the beta release ?
Similar issue on RedHat EL5! Also with tail plugin!
It's probably a permissions issue, try running sudo -u telegraf telegraf -config ..., the telegraf user must have permission to access that file.
that being said, if it is a permissions issue, there should be an error message about that.
I just made the test and you're right @sparrc this is about permission on log file.
Thank you !
Add an error message to the log will help the user. :)
I installed Telegraf this morning and configured logparser. Nothing's been written all day, and I suspect its permissions. Telegraf gives no indicator of that in /var/log/telegraf/telegraf.log, though
Most helpful comment
I just made the test and you're right @sparrc this is about permission on log file.
Thank you !
Add an error message to the log will help the user. :)