[Ilugc] Proxy

  • From: scuffy_tomy@xxxxxxxxxxx (kannan manoharan)
  • Date: Thu Aug 24 14:17:31 2006

Hi
 
 Option in my squid.conf :
 
 #  TAG: emulate_httpd_log       on|off
 #       The Cache can emulate the log file format which many 'httpd'
 #       programs use.  To disable/enable this emulation, set
 #       emulate_httpd_log to 'off' or 'on'.  The default
 #       is to use the native log format since it includes useful
 #       information Squid-specific log analyzers use.
 #
 #Default:
 # emulate_httpd_log off
 
  shall i mail the option enable ?
 
 i have tried  " tail -f /var/log/squid/access.log | awk '{print $7}' "
 yes, it shows url.
 
 My need is : to see URL with Client IP address.
 
 Kannan M
 
Senthil Kumaran S <stylesen@xxxxxxxxx> wrote: On 8/24/06, kannan manoharan  
wrote:

 If i ran "python geturl.py /var/log/squid/access.log | less" it says :

 Complete blank page and in end of the page "lines ?-?/? (END)"


Yeah I understand your problem. This needs some more insight about
your squid.conf. Just open your squid.conf file and see whether there
is a line called

"emulate_httpd_log on"

If the above is present then your log format will be "common log file
format" in squid terms which will look like this

remotehost rfc931 authuser [date] "method URL" status bytes

For the above format my script works.

If you have not enabled emulate_httpd_log then your log file format is
called "native log file format" which is the default for squid.conf
and it looks like this

For squid 1.0:
time elapsed remotehost code/status/peerstatus bytes method URL

For squid 1.1:
time elapsed remotehost code/status bytes method URL rfc931
peerstatus/peerhost type

And for squid 2.0 there is a small difference in the content.

So when it is this case my script fails. Another easy way to achive
the same thing which my script does is by use of a command :

$ tail -f /var/log/squid/access.log | awk '{print $7}'

The above command is generic enough and works fine for both common and
native file formats. So I would prefer if you use the above command
then you will get what you expect.. Just kick it off and let me know..
Still if you are unable to get the output am ready to help you.

PS: Since I used common log file format based access.log so my python
script failed to perform for native log file format.

-- 
--sen--
Be a man of Deeds
Don't be a man of Needs...
http://stylesen.blogspot.com
http://geocities.com/sen_kavithai


                                
---------------------------------
 Here's a new way to find what you're looking for - Yahoo! Answers 
 Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it 
NOW

Other related posts: