#配置nginx
您需要至少运行nginx版本1.7.1,该版本引入了syslog支持。
#将此添加到您的nginx配置文件并重新启动服务:
log_format graylog2_format '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for" <msec=$msec|connection=$connection|connection_requests=$connection_requests|millis=$request_time>';
#replace the hostnames with the IP or hostname of your Graylog2 server
access_log syslog:server=graylog2.example.org:12301 graylog2_format;
error_log syslog:server=graylog2.example.org:12302;
#参考链接
https://marketplace.graylog.org/addons/572ff823-62cc-468e-af17-300bcfd9932d