[squid-users] Custom Log with Client Source Port in 2.6

From: Gary Lau <gary@dont-contact.us>
Date: Thu, 2 Nov 2006 19:47:39 +0800

Referring to
tor 2006-10-05 klockan 09:21 +0200 skrev Michele de Varda:

>> I have installed squid 2.5 stable 14 with the patch "Squid custom log
>> format". I need to log source client port for distinguishing client
>> connection behind NAT/PAT networks. In the patch syntax the source
>> client port is defined with "%>p" but this function seems to not be yet
>> implemented. Is it possible to know if anyone has implemented this
>> feature?
>
>As far as I know it has not been implemented yet.
>
>Note: The custom log format is supported by default in Squid-2.6.
>
>Regards
>Henrik

I'm facing the same problem, i need to distinguish clients connection behind
NAT networks

I changed the source code in 2.6 myself to make squid logging client soruce
port
 I would like to share the modifed code with the developers and ppl who are
looking for this function.

in src/access_log.c

change line
*LFT_CLIENT_PORT, */
to
LFT_CLIENT_PORT,

change
*{ ">p", LFT_CLIENT_PORT}, */
to
{ ">p", LFT_CLIENT_PORT},

change
/* case LFT_CLIENT_PORT: */
to
case LFT_CLIENT_PORT:
     if (al->request) {
  outint = al->request->client_port;
  doint = 1;
     }
     break;

then u can log, in your custom format with %>p

Regards
Gary Lau (Admire123)
Received on Thu Nov 02 2006 - 04:41:13 MST

This archive was generated by hypermail pre-2.1.9 : Fri Dec 01 2006 - 12:00:02 MST