Patch adding more Apache LogFormat support to varnishncsa ( based on previous patch )

Javier Frias jfrias at
Tue Oct 27 18:42:14 CET 2009

Figured some people will find this useful, until varnishncsa gets full
LogFormat support.

I've expanded Emil Isberg's initial path on the following items:

List of what I added/fixed:

- Fixed segfault in %s,%>s, when these where not found in shmlog
- Fixed segfault in %{VarnishR}i, when df_H, Protocol version, was not
found, http defaults to HTTP/1.0
- Added %D, ( proc_time + xmit_time ) in microseconds
- Added $T, same as above, but in seconds
- Added %V, faked as %{Host}i ( different meaning in apache, but usually
meant as vhost )
- Added %{Age}i, age of object being served. Quite useful, as you can graph
things like average age of served pages, cache hit ratios, etc etc.

I attach a diff against stock 2.0.4 varnish, I've tested this against
several multi-gigabyte varnish native logs, as well as have it run for a few
days now, with no issues.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: varnishncsa-logformat-newfullpatch.diff
Type: text/x-patch
Size: 9305 bytes
Desc: not available
URL: <>

More information about the varnish-dev mailing list