nginx日誌格式html
log_format main '$host ' '$server_addr ' '$remote_addr ' '- ' '"$time_local" ' '$status ' '$body_bytes_sent ' '$request_time ' '"$http_referer" ' '"$request" ' '"$http_user_agent" ' '$pid';
安裝pattern位置在:/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-patterns-core-4.0.2/patterns 建立一個規則nginxnginx
%{HOSTNAME:host} %{IP:resip} %{IP:clientip} - "%{HTTPDATE:timestamp}" %{INT:response} %{INT:body_bytes_sent} %{NUMBER:requesttime:float} %{QS:referrer} %{QS:request} %{QS:agent} %{NUMBER:ngxpid}
使用grok debugger進行調試 Grok debugger傳送門ruby