haproxy/contrib/halog
Olivier Burgard e97b904801 CONTRIB: halog: Filter input lines by date and time through timestamp
I wanted to make a graph with average answer time in nagios that takes only
the last 5 mn of the log. Filtering the log before using halog was too
slow, so I added that filter to halog.

The patch attached to this mail is a proposal to add a new option : -time
[min][:max]

The values are min timestamp and/or max timestamp of the lines to be used
for stats. The date and time of the log lines between '[' and ']' are
converted to timestamp and compared to these values.

Here is an exemple of usage :
cat /var/log/haproxy.log | ./halog -srv -H -q -time $(date --date '-5 min' +%s)
2014-05-23 16:18:48 +02:00
..
fgets2.c OPTIM: halog: make use of memchr() on platforms which provide a fast one 2012-06-12 08:52:22 +02:00
halog.c CONTRIB: halog: Filter input lines by date and time through timestamp 2014-05-23 16:18:48 +02:00
Makefile OPTIM: halog: make use of memchr() on platforms which provide a fast one 2012-06-12 08:52:22 +02:00