]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CONTRIB: halog: Filter input lines by date and time through timestamp
authorOlivier Burgard <o.burgard@gmail.com>
Thu, 22 May 2014 14:44:59 +0000 (16:44 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 23 May 2014 14:18:48 +0000 (16:18 +0200)
commite97b9048016977feceb2b21f14a6e5cfea34d295
tree9f92ae79d34b0033b6040375ea276b36c411e8e3
parent248a60e9bfeac260a82601391e8e9086f17f31f3
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)
contrib/halog/halog.c