Re[2]: [squid-users] Getting deep into log files...

From: Pedro Lineu Orso <[email protected]>
Date: Thu, 6 Dec 2001 09:51:34 -0200

Or you can use this little C to convert your date/time:

#include <stdio.h>
#include <sys/time.h>

int main(argc,argv)
   int argc;
   char *argv[];
{

   time_t tt;
   struct tm *t;
   char tbuf[128];

   tt=atoi(argv[1]);
   (char *)t=localtime(&tt);
   strftime(tbuf, 127, "%m/%d/%Y", t);
   printf("%s\n",tbuf);
}

gcc btime.c -o btime
btime 1007639416.561

Pedro

Thursday, November 29, 2001, 2:02:06 PM, you wrote:

I> Or, try this:

I> perl -pe 's/\d+/localtime($&)/e' access.log 1> access.log.new

I> ----- Original Message -----
I> From: "Boniforti Flavio" <boniforti.f@co-ver.it>
I> To: <squid-users@squid-cache.org>
I> Sent: Thursday, November 29, 2001 10:28 AM
I> Subject: [squid-users] Getting deep into log files...

>> Hello there!
>>
>> I want to check my LOG file to find out which IPs connected to my proxy
>> after a certain hour.
>>
>> Is it possible???
>>
>> May I sort a copy of my yesterday access log (I've got daily rotations) by
>> time and get the info I need??? Ah, BTW: time would be better viewed in a
>> "human redable" format! :-)
>>
>> Thanx
>>
>>
>> Boniforti Flavio
>> Informa Srl
>> Via 42 Martiri, 165
>> 28924 Verbania (VB)
>> Tel +39 0323 586216
>> Fax +39 0323 586672
>> http://www.co-ver.it/informa
>>
>>
>>
>>
Received on Thu Dec 06 2001 - 04:51:38 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:05:14 MST