How to show IP address and Client Names on Squid Logs
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
How to show IP address and Client Names on Squid Logs
Hi Sirs,
Im using Debian ETCH as a proxy server here in our SOHO. I'd like to know how to set the squid logs to also show the client's names requesting the url and their IP address.
As of now, when I type in tail -f /var/log/squid/access.log it only shows the URLs.
Second, I would also like to know how long the logs are kept in the server like what is the default time. Somehow, it seems like it only shows the last 30 min logs of a single user.
How do I also edit this to show at least all of the logs for a number of days.
I tried to turn emulate_httpd_log on and tried to enable each of the logformat like combine and common, and lastly the option log_ip_on_direct to on, still I get the same format of logs which really does not show me the IP address and time.
@slacker_me
Use another box to test squid, so you'll the IP of that box
@yoh101
I guess that the OP just sees localhost because he uses the same box running squid to test
The default "client_netmask 255.255.255.255" should display the whole IP of the client, while "client_netmask 255.255.255.0" will replace the last octet with "0".
sorry for being quite dumb in asking this but im not really sure wat you mean by using another box to test squid.
My squid box is also a dhcp server so i know all of the ip addresses of each of the clients passing through squid.
However, all just shows localhost in the logs instead of their ips.
I thought that you're checking squid from the computer running squid. It seems that the same box runs except from squid and dhcpd, a firewall that masquerades the LAN IPs.
You can turn of masquerading and see if it works.
In addition to this, wouldnt it be much easier to have logs display the client's username? have you tried this? coz i think im sure i was able to include the options UL and UN in my logformat but it does not show it still. is this still affected by masquerade in iptables?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.