I'm using Varnish 3.0.3 on RHEL 6 as a caching load balancer in front of several Apache web servers and want to keep a log of when Varnish sees the back-ends change from healthy to sick and back again.
From the command line I can run varnishlog -O -I "Back healthy|Went sick"
and see lines like the following:
0 Backend_health - webserver1 Went sick 4--X--- 2 3 5 0.000000 0.000679
0 Backend_health - webserver1 Back healthy 4--X-RH 3 3 5 0.000622 0.000679 HTTP/1.1 200 OK
I'd love to write these sick/healthy state changes to a log file, but they are useless without having timestamps associated with them. How can I write these lines to a log file and include timestamps for each line?