Thanks for the advise Elsen,
But I cant use any pre-written scripts because I'm writing my own
software ( http://iwall.sourceforge.net/ ) for a specific purpose, not
as a squid log analyser, but as a linux system administration tool.
Basically the software allows system administrators to create user
accounts, and define an ip address for each account.
The software then configures ACL's in the squid.conf, and create rules
in the Iptables firewall.
It is then designed to parse the squid access log to find out how much
each account has downloaded, it adds the byte count for each request for
each account to a database.
Once this information is in the database the software then gives the
administrator the ability to see how much each account is downloading,
the administrator can define how much to charge each account per
megabyte downloaded and generate bills, the administrator can also set
limits on accounts so that if they reach a download limit (say 500
megabytes), the account is automatically disabled by a process which
runs in the back ground, the account cant use the internet until they
pay their bill.
So as you can see, the software I'm writing isn't just a squid log
analyser, it's a bit more than that and because of this I need to be
able to parse my own squid log to gather the info I need.
So is anyone able to tell me how I can tell squid to only dump specific
information to the access.log. specific information being the ip address
of the client making the request, and the byte count sent to the client?
Any help much appreciated.
Regards,
Chris Barnes.
-----Original Message-----
From: Elsen Marc [mailto:elsen@imec.be]
Sent: Wednesday, 25 February 2004 7:39 PM
To: Chris Barnes; Squid-users
Subject: RE: [squid-users] access.log format.
>
> Hi Squiders,
> Is there a way I can chose what information squid logs to the
> access.log? for example, I'm writing a piece of software and the only
> information I'm worried about are the ip address of the client which
> made the request, and the bytes sent to that client.
>
> This would be so much easier for me because at the moment I have to
> parse each line of the access.log then break it down into
> pieces and try
> to determine which piece refers to client ip and which piece refers to
> bytes sent to client. This doesn't always work properly and
> as a result,
> my software ends up trying to add the value of a mime type of
> a request
> to the total bytes a client has downloaded instead of it adding the
> bytes received for a request to the total bytes a client has
> downloaded.
>
> Am I making any sense? What are your thoughts?
>
Yes, but existing stuff may already have what you want :
http://www.squid-cache.org/Scripts/
I use Calamaris, which also gives overviews of how much traffic
was send to a client.
M.
Received on Wed Feb 25 2004 - 03:42:38 MST
This archive was generated by hypermail pre-2.1.9 : Mon Mar 01 2004 - 12:00:03 MST