Custom varnishncsa Log Format?

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


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 36123 1596686019
   16 RxHeader     c X-Forwarded-For:

Instead of ncsa lines like: - - [16/Sep/2008:14:07:15 +0200] "GET / HTTP/1.0" 200 898 "-"

I'd like to see - - [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?

-- Lukas

More information about the varnish-misc mailing list