Comment 7 for bug 1780341

Revision history for this message
Haw Loeung (hloeung) wrote :

| logformat custom-squid %tg{%F %H:%M:%S %z} %6tr %>a %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt

Doesn't work in older squid (3.5 in Xenial for example) and causes parse failures:

| 2022/07/25 00:41:49| Processing: logformat custom-squid %tg{%F %H:%M:%S} %6tr %>a %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt
| FATAL: Can't parse configuration token: '%F %H:%M:%S} %6tr %>a %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt'
|
| Squid Cache (Version 3.5.12): Terminated abnormally.

It looks like the strftime format needs to prefix the time related format code, so '%tg{%F %H:%M:%S}' needs to be '%{%F %H:%M:%S}tg'.

| 2022/07/25 01:09:59| Processing: logformat custom-squid %{%F %H:%M:%S}tg %6tr %>a %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt
| ...