No commit activity in last 3 years
No release in over 3 years
Parser for HAProxy logs in the HTTP log format
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.5.0

Runtime

 Project Readme

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"]