varnishncsa -F flag custom log format

Rowan @ Jetboy rowan at jetboy.co.uk
Sun May 27 16:09:55 CEST 2012


Hi Daniel,

Thanks for the reply. I've tried entirely replacing my code with yours
(other than the capitalisation of $PIDFILE, and putting $logfile inline),
but I get similar results. It's only recording the first log parameter in
the log (in this case, the host IP). The single quotes result in the first
single quote being recorded in the log. E.g.:

'66.249.72.57
'157.55.17.194

Are you running Varnish on Linux with bash, or some other OS flavour?


<snip>

This one works for me:

LOG_FORMAT="%h %l %u %t \"%r\" %s %b \"%{Referer}i\"
\"%{User-agent}i\" %{Host}i %{Varnish:time_firstbyte}x"
DAEMON_OPTS="-c -a -w $logfile -D -P $pidfile -F '${LOG_FORMAT}'"

Please, note the single quotes in -F

Hope this help.

</snip>




More information about the varnish-misc mailing list