Re: [SQU] Converting time format

From: Awie <[email protected]>
Date: Thu, 8 Feb 2001 09:29:48 +0800

Folks,

I am sure that everyone has their own favorite method.

I feel that piping is the best way for me. The reason is I get a flexibility
to use any utility viewing the log. Let say, I want to filter an IP address
that accessing Internet through Squid. I just type:

grep 'aaa.bbb.ccc.ddd' access.log | /bin/convert

Then I got all of the activity of user that has IP aaa.bbb.ccc.ddd in a
readable format. If I want to save the result in a file, I juts add ">
filename".

Best Regards,

Awie

----- Original Message -----
From: "Thomas Adam" <thomas_adam16@yahoo.com>
To: "Awie" <awie@eksadata.com>; "ajay chaudhari" <ajaylinux@yahoo.com>;
<squid-users@ircache.net>
Sent: Wednesday, February 07, 2001 10:52 PM
Subject: Re: [SQU] Converting time format

> Hi,
>
> Awie's methods are accurate, but instead of piping the
> output, I tend to save the perl script, and then chmod
> 700 ./filename. (Awie, this is important as it sets
> the executable status on the file!!). I then copy the
> perl script into the folder that contains the
> access.log and type the following:
>
> ./perlscript <access.log >access2.log
>
> and then I view access2.log.
>
> Regards,
>
> Thomas Adam
> --- Awie <awie@eksadata.com> wrote: > Hi,
> >
> > The script is pretty simple, I just created a TEXT
> > file (i.e convert) in
> > directory (i.e /bin) that contain line as below (1
> > line) :
> >
> > /usr/bin/perl -pe 's/\d+/localtime $&/e;'
> >
> > Then I run chmod +x /bin/convert (I did not know it
> > is necessary or not).
> >
> > After that, I went to my Squid's log directory and
> > run ANY utility that able
> > to view the log such as "grep" or "cat" or "vi" or
> > whatever with pipe to my
> > file. i.e:
> >
> > vi access.log | /bin/convert
> >
> > I got a readable format of time & date of my
> > access.log.
> >
> > Hope it is clear enough.
> >
> > Thx
> >
> > Awie
> >
> > ----- Original Message -----
> > From: "ajay chaudhari" <ajaylinux@yahoo.com>
> > To: <squid-users@ircache.net>
> > Sent: Wednesday, February 07, 2001 1:40 PM
> > Subject: Re: [SQU] Converting time format
> >
> >
> > > > --- Awie <awie@eksadata.com> wrote: > All,
> > > > >
> > > > > I created a script;
> > > > >
> > > > > /usr/bin/perl -pe 's/\d+/localtime $&/e;'
> > > > >
> > > > > and save it to be a file named "convert" in
> > > > > directory /bin. Then I run "chmod +x
> > /bin/convert"
> > > > >
> > > > > After all, I run "cat access.log |
> > /bin/convert".
> > > > >
> > > > > IT WORKS !
> > > > >
> > >
> > > Hi Awie can you send the script to me and give
> > details
> > > as to how to use it, I am useing Redhat Linux 6.2.
> > >
> > > Warm Regards
> > >
> > > Ajay
> > >
> > >
> > >
> > > =====
> > > Warm Regards
> > >
> > > Ajay Chaudhari
> > > Mumbai
> > > pager:-9602-101616
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Auctions - Buy the things you want at great
> > prices.
> > > http://auctions.yahoo.com/
> > >
> > > --
> > > To unsubscribe, see
> > http://www.squid-cache.org/mailing-lists.html
> > >
> >
> >
> >
> > --
> > To unsubscribe, see
> > http://www.squid-cache.org/mailing-lists.html
> >
>
>
> =====
> Thomas Adam
> Linux Co-ordinator for The Purbeck School
>
> e-mail (school): n6tadam@users.purbeck.dorset.sch.uk
> e-mail (yahoo) : thomas_adam16@yahoo.com
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/
>
> --
> To unsubscribe, see http://www.squid-cache.org/mailing-lists.html
>

--
To unsubscribe, see http://www.squid-cache.org/mailing-lists.html
Received on Wed Feb 07 2001 - 18:45:08 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:57:55 MST