haproxy 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. ## These patterns were tested w/ haproxy-1.4.15
  2. ## Documentation of the haproxy log formats can be found at the following links:
  3. ## http://code.google.com/p/haproxy-docs/wiki/HTTPLogFormat
  4. ## http://code.google.com/p/haproxy-docs/wiki/TCPLogFormat
  5. HAPROXYTIME (?!<[0-9])%{HOUR:haproxy_hour}:%{MINUTE:haproxy_minute}(?::%{SECOND:haproxy_second})(?![0-9])
  6. HAPROXYDATE %{MONTHDAY:haproxy_monthday}/%{MONTH:haproxy_month}/%{YEAR:haproxy_year}:%{HAPROXYTIME:haproxy_time}.%{INT:haproxy_milliseconds}
  7. # Override these default patterns to parse out what is captured in your haproxy.cfg
  8. HAPROXYCAPTUREDREQUESTHEADERS %{DATA:captured_request_headers}
  9. HAPROXYCAPTUREDRESPONSEHEADERS %{DATA:captured_response_headers}
  10. # Example:
  11. # These haproxy config lines will add data to the logs that are captured
  12. # by the patterns below. Place them in your custom patterns directory to
  13. # override the defaults.
  14. #
  15. # capture request header Host len 40
  16. # capture request header X-Forwarded-For len 50
  17. # capture request header Accept-Language len 50
  18. # capture request header Referer len 200
  19. # capture request header User-Agent len 200
  20. #
  21. # capture response header Content-Type len 30
  22. # capture response header Content-Encoding len 10
  23. # capture response header Cache-Control len 200
  24. # capture response header Last-Modified len 200
  25. #
  26. # HAPROXYCAPTUREDREQUESTHEADERS %{DATA:request_header_host}\|%{DATA:request_header_x_forwarded_for}\|%{DATA:request_header_accept_language}\|%{DATA:request_header_referer}\|%{DATA:request_header_user_agent}
  27. # HAPROXYCAPTUREDRESPONSEHEADERS %{DATA:response_header_content_type}\|%{DATA:response_header_content_encoding}\|%{DATA:response_header_cache_control}\|%{DATA:response_header_last_modified}
  28. # parse a haproxy 'httplog' line
  29. HAPROXYHTTPBASE %{IP:client_ip}:%{INT:client_port} \[%{HAPROXYDATE:accept_date}\] %{NOTSPACE:frontend_name} %{NOTSPACE:backend_name}/%{NOTSPACE:server_name} %{INT:time_request}/%{INT:time_queue}/%{INT:time_backend_connect}/%{INT:time_backend_response}/%{NOTSPACE:time_duration} %{INT:http_status_code} %{NOTSPACE:bytes_read} %{DATA:captured_request_cookie} %{DATA:captured_response_cookie} %{NOTSPACE:termination_state} %{INT:actconn}/%{INT:feconn}/%{INT:beconn}/%{INT:srvconn}/%{NOTSPACE:retries} %{INT:srv_queue}/%{INT:backend_queue} (\{%{HAPROXYCAPTUREDREQUESTHEADERS}\})?( )?(\{%{HAPROXYCAPTUREDRESPONSEHEADERS}\})?( )?"(<BADREQ>|(%{WORD:http_verb} (%{URIPROTO:http_proto}://)?(?:%{USER:http_user}(?::[^@]*)?@)?(?:%{URIHOST:http_host})?(?:%{URIPATHPARAM:http_request})?( HTTP/%{NUMBER:http_version})?))?"
  30. HAPROXYHTTP (?:%{SYSLOGTIMESTAMP:syslog_timestamp}|%{TIMESTAMP_ISO8601:timestamp8601}) %{IPORHOST:syslog_server} %{SYSLOGPROG}: %{HAPROXYHTTPBASE}
  31. # parse a haproxy 'tcplog' line
  32. HAPROXYTCP (?:%{SYSLOGTIMESTAMP:syslog_timestamp}|%{TIMESTAMP_ISO8601:timestamp8601}) %{IPORHOST:syslog_server} %{SYSLOGPROG}: %{IP:client_ip}:%{INT:client_port} \[%{HAPROXYDATE:accept_date}\] %{NOTSPACE:frontend_name} %{NOTSPACE:backend_name}/%{NOTSPACE:server_name} %{INT:time_queue}/%{INT:time_backend_connect}/%{NOTSPACE:time_duration} %{NOTSPACE:bytes_read} %{NOTSPACE:termination_state} %{INT:actconn}/%{INT:feconn}/%{INT:beconn}/%{INT:srvconn}/%{NOTSPACE:retries} %{INT:srv_queue}/%{INT:backend_queue}