Skip to content

A Ruby library to parse logs in HAProxy's HTTP log format

License

Notifications You must be signed in to change notification settings

tobyhs/haproxy_log_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

haproxy_log_parser

Build Status

haproxy_log_parser is a gem that parses logs in HAProxy's HTTP log format. Use HAProxyLogParser.parse to parse a line; this will return an HAProxyLogParser::Entry for normal lines and HAProxyLogParser::ErrorEntry for connection error lines.

Example:

require 'haproxy_log_parser'
result = HAProxyLogParser.parse('Aug  9 20:30:46 localhost haproxy[2022]: 10.0.8.2:34028 [09/Aug/2011:20:30:46.429] proxy-out proxy-out/cache1 1/0/2/126/+128 301 +223 - - ---- 617/523/336/168/0 0/0 {www.sytadin.equipement.gouv.fr||http://trafic.1wt.eu/} {Apache|230|||true} "GET /index.html HTTP/1.1"')
result.client_ip # => "10.0.8.2"
result.captured_response_headers # => ["Apache", "230", "", "", "true"]

About

A Ruby library to parse logs in HAProxy's HTTP log format

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages