title: Rsyslog imfile permission denied
body: <p>I'm trying to use rsyslog imfile to send logs contained in Jenkins log files to a Graylog server, I added root user to jenkins group but I've still permissions issues when rsyslog tries to read files.</p>
  
  <p>Here is the rsyslog script :</p>
  
  <pre><code>module(load="imfile")
  ruleset(name="infiles") {
      action(type="omfwd"
      target="graylog.server"
      protocol="tcp" port="1514" )
  }
  input(type="imfile" tag="jenkinsJobs"
  file="/var/lib/jenkins/jobs/*/builds/*/log")
  </code></pre>
  
  <p>And I get the following error :</p>
  
  <p><code>imfile: poll_tree cannot stat file '/var/lib/jenkins/jobs/test/builds/legacyIds' - ignored: Permission denied [v8.1901.0]</code></p>
  
  <p>I also tried to let user jenkins execute the script but he can't send back logs to rsyslog, since he hasn't the permissions.</p>