Telegraf Tails Plugin

Hi all,

I am trying to read data from the syslog logfile with the tail plugin. My Telegraf environment runs in a Docker container. But I always get permission denied when I try to read the file. I have already tried to change the user, but it looks like telegraf is always executed in the container with the telegraf user who has no read permissions on the file. What can I do?

[[inputs. Tail]]

  files = ["/test/syslog"]
  from_beginning = false
  data_format = "grok"
  grok_patterns = ['''%{MONTH:month} %{MONTHDAY:day} %{TIME:time} %{HOSTNAME:host} %{WORD:source}: \[%{NUMBER:kernel_timestamp}\] %{GREEDYDATA:message}''']
2024-02-20T13:01:09Z D! [outputs.postgresql] Buffer fullness: 0 / 10000 metrics

2024-02-20T13:01:09Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics

2024-02-20T13:01:10Z D! [inputs.tail] Failed to open file (/test/syslog): open /test/syslog: permission denied

2024-02-20T13:01:19Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics

2024-02-20T13:01:19Z D! [outputs.postgresql] Buffer fullness: 0 / 10000 metrics

2024-02-20T13:01:20Z D! [inputs.tail] Failed to open file (/test/syslog): open /test/syslog: permission denied

2024-02-20T13:01:29Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics

2024-02-20T13:01:29Z D! [outputs.postgresql] Buffer fullness: 0 / 10000 metrics

2024-02-20T13:01:30Z D! [inputs.tail] Failed to open file (/test/syslog): open /test/syslog: permission denied

If you add the telegraf user to the “root” group, this should give it read
permission on syslog.

Antony.