Re: Problem with Debugging Useragent

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: Problem with Debugging Useragent

Amos Jeffries
On 7/05/20 4:11 am, Ahmad Alzaeem wrote:

> Hello Floks ,
> We have squid 4.x
> We need to debug the user agents being  sent from our local network .
> We added :
> logformat useragent  %>a [%tl] "%{User-Agent}>h"
> access_log stdio:/var/log/squid/${service_name}-useragent.log useragent

The only thing wrong with that config is that the "useragent" is a
built-in logformat name. Do not re-define it.

If you want any differences to the built-in, use a different name for
your custom format.

> But out logs only logs as below :
> [06/May/2020:12:09:56 -0400] "-"
> It seems to be “-“   , Not the useragent we suppose to see .

What makes you think those transactions have User-Agent headers?
The '-' means no such header present.

> How can we let squid debug the incoming user agent and the outgoing user agent what go out  to the website ?

You can try this to see what the headers actually contain.

  logformat ualog  %>a [%tl] "%{User-Agent}>h" "%>h"
  access_log stdio:/var/log/squid/${service_name}-useragent.log ualog

If the string with full headers contain 'User-Agent:' when "-" is
displayed first there is a bug, otherwise it is just your expectation
being incorrect.

squid-users mailing list
[hidden email]