Custom varnishncsa Log Format?

Loesche, Lukas, ZD-Scoyo lukas.loesche at bertelsmann.de
Tue Sep 16 14:11:39 CEST 2008


Hi,

I got a question regarding custom ncsa log formats. Are they possible?

We got varnish behind a loadbalancer. The loadbalancer sets the
X-Forwarded-For Header. When processing logs using varnishncsa I'd like to
see the content of X-Forwarded-For as remote addr, instead of the
loadbalancer's source IP.

E.g. for a request with
   16 ReqStart     c 172.19.0.28 36123 1596686019
...
   16 RxHeader     c X-Forwarded-For: 217.115.75.232

Instead of ncsa lines like:

172.19.0.28 - - [16/Sep/2008:14:07:15 +0200] "GET / HTTP/1.0" 200 898 "-"
"-"

I'd like to see

217.115.75.232 - - [16/Sep/2008:14:07:15 +0200] "GET / HTTP/1.0" 200 898 "-"
"-"


Is there an easy way to achieve this, without having to write a custom
varnishlog parser that generates ncsa output?


Regards,
-- Lukas




More information about the varnish-misc mailing list