[squid-users] customlog format, only log URL path?

From: Michael Pye <michael@dont-contact.us>
Date: Wed, 1 Jun 2005 17:34:03 +0100

#logformat to emulate from apache
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{cookie}n\" \"-\" %T %v \"%{Cookie}i\"" auditnew2

# using this in squid 2.5 with custlom patch
logformat auditnew2 %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" "-" "-" %tr %{Host}>h "%{Cookie}>h"

The above apache logformat line is what I am trying to emulate in Squid
2.5 with the customlog patch. I have it working pretty much with only a
couple of differences.

%r in Apache only logs the URL path of the request, i.e.
/mydir/myfile.gif, wheres %ru in Squid logs the full URL requested, i.e.
www.mydomin.com/mydir/myfile.gif. Is it possible to get Squid to only
log the URL path part ?

I've left out the apache %{cookie}n as this has to come from an apache
module, which is obviously not available in Squid.

The apache %T logs the time taken to process the request in seconds
whereas the Squid %tr logs the time taken in milliseconds. Anyway of
getting Squid to log this in seconds ? I guess the easiest would be just
to modify the customlog patch to divide the value by 1000 and round it
up before logging it.

--
Michael Pye
Received on Wed Jun 01 2005 - 10:34:23 MDT

This archive was generated by hypermail pre-2.1.9 : Fri Jul 01 2005 - 12:00:02 MDT