[squid-users] logformat for requests using PROXY protocol

Amos Jeffries squid3 at treenet.co.nz
Fri Nov 15 05:15:16 UTC 2019


On 15/11/19 2:56 pm, chammidhan wrote:
> I have configured a Squid ECS cluster behind a network load balancer in AWS.
> To reflect the original client IP, I needed to enable PROXY Protocol V2 on
> the load balancer. The service itself is working fine and I can create rules
> based on the original client IP and these are applied as expected. However,
> it doesn't seem that logformat format codes are working as expected. No
> matter how I format the logs, I'm always seeing the logs in the same format.
> Which looks like below.
> 
> 1573771498.693 240116 10.181.3.10 TCP_TUNNEL/200 1742 CONNECT
> id.google.com:443 - HIER_DIRECT/172.217.167.67 -
> 
> My logformat directive is the default
> logformat squid %{%Y/%m/%d-%H:%M:%S}tl %>A/%>a %un %rm/%rv %ru %mt
> %{User-Agent}>h %>st/%<st %tr %>Hs %Ss %Sh/%<A
> 
> Appreciate any insight to what I may be doing wrong. Things were working
> fine before enabling PROXY protocol on the NLB
> 

Please run "squid -k parse" on your config and fix the errors and
warnings it produces.

"
2019/11/15 18:11:50| Processing: logformat squid %{%Y/%m/%d-...
2019/11/15 18:11:50| ERROR: logformat squid is already defined. Ignoring.
"

To use a custom log format you need a custom name.


Amos


More information about the squid-users mailing list