<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Running Varnish 3.02 rev. cbf1284 on Ubuntu Server 12.04 LTS x64:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I can get varnishncsa writing to logs successfully with:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>VARNISHNCSA_ENABLED=1<o:p></o:p></p><p class=MsoNormal>DAEMON_OPTS="-a \<o:p></o:p></p><p class=MsoNormal> -c \<o:p></o:p></p><p class=MsoNormal> -D \<o:p></o:p></p><p class=MsoNormal> -P ${PIDFILE} \<o:p></o:p></p><p class=MsoNormal> -w /var/log/varnish/hollywood.varnishncsa.log"<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>in /etc/default/varnishncsa<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>but I'm really struggling with the -F flag for custom log formats. I'm trying to achieve an Apache combined log format prefixed by the virtual host, which'd look something like this:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>%{Host}i %h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\"<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>but all I'm managing to do is capture the %{Host}i bit in the logfile.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>There's an old thread on here about issues with spaces and escaping quotes, but the responses are all about setting the format on the command line, which I'm really trying to avoid. I've got to:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>VARNISHNCSA_ENABLED=1<o:p></o:p></p><p class=MsoNormal>FORMAT="%{Host}i %h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\""<o:p></o:p></p><p class=MsoNormal>DAEMON_OPTS="-a \<o:p></o:p></p><p class=MsoNormal> -c \<o:p></o:p></p><p class=MsoNormal> -D \<o:p></o:p></p><p class=MsoNormal> -F ${FORMAT} \<o:p></o:p></p><p class=MsoNormal> -P ${PIDFILE} \<o:p></o:p></p><p class=MsoNormal> -w /var/log/varnish/hollywood.varnishncsa.log"<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I've tried various permutations of single and double quotes, and the format both in and out of a variable. No luck so far. Can anyone help me out?<o:p></o:p></p></div></body></html>