[experimental-ims] 0471b9b Add support for the %{format}t construct to varnishncsa
Geoff Simmons
geoff at varnish-cache.org
Mon Jan 16 17:58:31 CET 2012
commit 0471b9bf34c477db127aa11132e4efd99a68ef37
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date: Mon Jan 16 10:12:14 2012 +0100
Add support for the %{format}t construct to varnishncsa
diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index 9da6172..9abb9b6 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -757,6 +757,11 @@ h_ncsa(void *priv, enum VSL_tag_e tag, unsigned fd,
VSB_cat(os, h ? h : "-");
p = tmp;
break;
+ case 't':
+ strftime(tbuf, sizeof tbuf, fname, &lp->df_t);
+ VSB_cat(os, tbuf);
+ p = tmp;
+ break;
case 'x':
if (!strcmp(fname, "Varnish:time_firstbyte")) {
VSB_cat(os, lp->df_ttfb);
diff --git a/doc/sphinx/reference/varnishncsa.rst b/doc/sphinx/reference/varnishncsa.rst
index 0b3f97f..9373f5c 100644
--- a/doc/sphinx/reference/varnishncsa.rst
+++ b/doc/sphinx/reference/varnishncsa.rst
@@ -90,6 +90,11 @@ The following options are available:
Time when the request was received, in HTTP date/time
format.
+ %{X}t
+ Time when the request was received, in the format
+ specified by X. The time specification format is the
+ same as for strftime(3).
+
%U
The request URL without any query string. Defaults to
'-' if not known.
More information about the varnish-commit
mailing list