Logstash.service can not read nginx access.log


(Bo8888) #1

vim /etc/systemd/system/logstash.service
User=logstash
Group=logstash

/etc/logstash/conf.d/nginx.conf

it is not work well

but
vim /etc/systemd/system/logstash.service
User=root
Group=root

it is work well

access.log user :nginx group:nginx


(Magnus Bäck) #2

Show ls -l output for the logfile in question as well as all directories leading up to it.


(Bo8888) #3

[root@bogon ~]# ll /var/log/nginx/access.log
-rw-rw-r--. 1 nginx nginx 23406 10月 16 17:20 /var/log/nginx/access.log


(Magnus Bäck) #4

And what about /var, /var/log, and /var/log/nginx?


(Bo8888) #5

drwx------. 2 nginx nginx 159 10月 16 09:16 nginx
drwxr-xr-x. 13 root root 4096 10月 16 09:16 log


(Magnus Bäck) #6

The nginx directory is clearly only accessible to the nginx user. The logstash user needs the executable bit set (possibly also the read bit depending on how the wildcard expansion has been implemented).


(system) #7

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.