Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Oct 2000 16:47:36 +0700
From:      "Rashid N. Achilov" <shelton@sentry.granch.ru>
To:        Sergey Nikolayev <awardbios@mail.ru>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: A question about log
Message-ID:  <39F40938.F2C9C5F2@sentry.granch.ru>
References:  <000801c03a65$a5e79760$210aa8c0@radiant.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Sergey Nikolayev wrote:

> located in Samara, Russia, is using a FreeBSD-based proxy (Squid? - not
> sure) to connect our office to the Internet. It is possible to get logs and
> control what was accessed, but what do all those records mean? In practice,
> I'm interested to see time when an URL was accessed, and the downloaded
> resource size.

Squid proxy could be configured to write its logs in httpd-like format,
but many Squid log analyzers confused, when try to parse it. If you will
automatic check your log, you can try Calamaris (exist in ports
collection). If you prefer to see log manually you can use this script
to convert in more readable format (first field - time, second - URL,
third - size)

#!/usr/bin/perl                                                               
                                                                              
if ($ARGV[0] eq
'')                                                           
 
{                                                                           
    printf STDERR "Input file missing. Run: newlog <in.file>
<out.file>\n";   
   
exit;                                                                     
 
}                                                                           
                                                                              
open(INLOG,$ARGV[0]);                                                         
                                                                              
while ($name =
<INLOG>)                                                       

{                                                                            
   chop
$name;                                                                
                                                                              
   @line =
split(/\s+/,$name);                                                
   $string =
localtime(@line[0]);                                             
                                                                              
   printf "%s %25s %10s %s %s %s %s %s %s
%s\n",$string,@line[2],@line[4],@line[5],@line[6],@line[1],@line[3],@line[7],@line[8],@line[9];

}                                                                            
                                                                              
close(INLOG);                                                                 
-- 
   With Best Regards.
   Rashid N. Achilov (RNA1-RIPE), Brainbench ID: 28514
   Granch Ltd. system administrator, e-mail: achilov@granch.ru
   tel/fax (383-2) 24-2363


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?39F40938.F2C9C5F2>