[squid-users] Changing the time format for access_log

Alex Rousskov rousskov at measurement-factory.com
Tue Nov 19 20:48:28 UTC 2019


On 11/19/19 2:08 PM, James Moe wrote:
> FATAL: Can't parse configuration token: '%Y-%m-%dT%H:%M:%S
> %z.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt'
> 
> What is the format error?

You are using logformat %codes unsupported by Squid, such as %Y, %m, and
%d. Please search the logformat documentation for "Time related format
codes": http://www.squid-cache.org/Doc/config/logformat/

Please note that %tl and %tg codes support a parameter. That parameter
is a strftime(3) format. strftime(3) does support %Y, %m, and %d
conversion specifications.

To specify a Squid %code parameter, use {curly braces}. IIRC, modern
Squids support a natural position for such parameters -- after the
%code. Here is an untested example:

 %tl{%Y-%m-%dT%H:%M:%S}


HTH,

Alex.


More information about the squid-users mailing list