Nginx remote access_log file

Reinis Rozitis r at roze.lv
Tue Aug 16 17:06:42 UTC 2016


> How can i store the accsess_log Nginx file in the second machine ?
> Or how can i set the a Logstash remote input file ?
> Should I user an other tool like logsatsh-forwarder ?

You can just write the nginx access log via syslog directly to logstash (or 
if you don't want that nginx writes something over network pretty much all 
syslog daemons  (syslog-ng, rsyslog etc) support of reading local files and 
piping them to a remote listener).


A generic example:

1. define the input (to whatever port you prefer) in logstash config:

input {
  udp {
    port => 5000
    type => syslog
  }
}


2. point the nginx log to it:

access_log syslog:server=your.logstash.ip:5000;

(more details about tagging the messages etc in 
http://nginx.org/en/docs/syslog.html )


rr 



More information about the nginx mailing list