帅帅男孩 发表于 2018-11-8 13:11:01

logstash实现nginx日志status报警

worker_processes1;  events {
  worker_connections1024;
  }
  http {
  include       mime.types;
  include /etc/nginx/conf.d/*.conf;
  default_typeapplication/octet-stream;
  log_formatmain'{"http_x_forwarded_for":"$http_x_forwarded_for","remote_user":"$remote_user","time_local":"$time_local","request":"$request","status":"$status","body_bytes_sent":"$body_bytes_sent","request_body":"$request_body","http_referer":"$http_referer","remote_addr":"$remote_addr","fastcgi_script_name":"$fastcgi_script_name","request_time":"$request_time","proxy_host":"$proxy_host","upstream_addr":"$upstream_addr","upstream_response_time":"$upstream_response_time","agent":"$http_user_agent"}';
  access_log/var/log/nginx/access.logmain;
  sendfile      on;
  keepalive_timeout65;
  upstream real_server {
  server 127.0.0.1:8080;
  }
  server {
  listen       80;
  server_nameasd.com;
  location / {
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_pass http://real_server;
  }
  error_page   500 502 503 504/50x.html;
  location = /50x.html {
  root   html;
  }
  }
  }

页: [1]
查看完整版本: logstash实现nginx日志status报警