Hi Sam,
only root can read and write to that file,
Users that are in the group adm can read the file,
All other users have no access to that file.
I see two solutions …
If you do a
chmod 644 /var/log/apache2/access.log
all other users will have read access … I don’t know if your company’s security rules allow that but it will solve your problem
Adding the user telegraf to the adm group is also a solution
I’m certain the files target is the same.
I’m also certain that there is data in this log file by visiting the site and confirming using tail on the source server.
Using Log Viewer I have yet to find these logs. This appears to be confirmed by reading /var/log/telegraf/telegraf.log
2019-09-05T12:22:20Z D! [outputs.influxdb] buffer fullness: 2 / 10000 metrics.
2019-09-05T12:22:30Z D! [outputs.influxdb] wrote batch of 2 metrics in 40.503876ms
When I re-enable syslog and restart telegraf I do get the syslogs, just nothing from logparser. If this is a permissions issue, I’m unsure what to try next to isolate the cause.
@Ben_59 To use --test with this plugin you will need a newer Telegraf version so you an use the --test-wait option. This is because this plugin streams data from the file instead of polling. You will also need to use the plugin name like so with --input-filter.
Keep in mind this will only read new lines added to the file.
[root@linux44:/tmp/TEL] telegraf -config /etc/telegraf/telegraf.conf --input-filter logparser --test
2020-04-16T07:46:28Z I! Starting Telegraf 1.14.1
2020-04-16T07:46:28Z E! [agent] Service for [inputs.logparser] failed to start: no pattern found for %{combined_log_format}
2020-04-16T07:46:28Z E! [telegraf] Error running agent: no pattern found for %{combined_log_format}