[squid-users] Problem with %tr in custom logformat in squid-2.7

From: BARRY J BLUMENFELD <bblumen1_at_jhu.edu>
Date: Thu, 17 Jul 2008 14:11:26 -0400

I have been using a custom logformat in squid for sometime (to feed to a custom AWStats).
The format is:

logformat awstats %>a %ui %un [%{%d/%b/%Y:%H:%M:%S +0000}tl] "%rm %ru HTTP/%rv" %Hs %<st %Ss:%Sh %tr "%{X-Frontier-Id}>h"

The %tr works fine in squid-2.6.STABLE18. Here is a piece of a log entry:
JTS5RMFRIK8rPVUgpTcwBAD0rBmw= HTTP/1.0" 200 822 TCP_MEM_HIT:NONE 0 "-"
                                                                                                        ^
                                                                                                        ^

giving a 0 for a memory hit.
However, I just tried the identical logformat with squid-2.7.STABLE3 and I get:
JTS5RMFRIK8rPVUgpTcwBAD0rBmw= HTTP/1.0" 200 812 TCP_MEM_HIT:NONE - "-"
                                                                                                        ^
                                                                                                        ^
where I get a - for the time.
When there is a request with a non-zero time it seems to work:
JTS5RMFRIK8rPVUgpTcwBAD0rBmw= HTTP/1.0" 200 805 TCP_MISS:DIRECT 337 "-"
                                                                                                       ^
                                                                                                       ^
It also seems to properly give a 0 with the native squid logformat.
All the the other fields in the custom format are correct.
To see if it was my format, I tried the squidmime format as given in squid.conf which uses %6tr
for the elapsed time. That also gave me a - for the time of memory hit.
I am using 32 bit linux OS.
What is causing the problem?

Barry
Received on Thu Jul 17 2008 - 18:11:27 MDT

This archive was generated by hypermail 2.2.0 : Fri Jul 18 2008 - 12:00:04 MDT