logstash-plugins / logstash-output-file

Apache License 2.0
23 stars 53 forks source link

logstash-output-file ignores write permissions in file_mode option #49

Open L4rS6 opened 8 years ago

L4rS6 commented 8 years ago

Logstash file output doesn't set the right write permissions:

output {
      file {
        path => "/var/log/test.log"
        codec => line { }
        file_mode => 0777
      }
}

Logfile gets the 0755 permissions: -rwxr-xr-x 1 root wheel 220 Nov 9 09:52 test.log

If file_mode is set to 0666 the logfile permissions are: 0644

jordansissel commented 8 years ago

This seems like a bug.

My guess is the behavior is caused by Logstash respecting your processes' umask setting, which usually is something like 022. As a workaround, you can probably set umask 000 and this problem will go away.

L4rS6 commented 8 years ago

Thank you for looking into this.