Hi
There is a function called str2time in HTTP::Date which will convert this
date format to epoch, I believe it can handle the TZ as well.

Also, you may want to look at the C app called mergelog which chrono sorts
multiple logfiles,

Regards
Matt


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
SuccessInMind
Sent: 23 June 2002 18:49
To: [EMAIL PROTECTED]
Subject: [Perl-unix-users] Sorting Records In Server Log Files


Hi all,

I have a little sorting dilemma.

I have combined two server access logs and I am wanting to sort the records
by the Date/time field. I can perform simple sorts but this one is out of my
expertise. The problem I am running into is that not only each record
include different field separators but the date is also alphanumeric which
compound the problem, but I am sure that there is a way to solve this issue.

Here is a sample of three records in the file - this is a rather large file
so an efficient streamline routine would be needed.

65.93.183.185 - - [25/Mar/2002:12:41:31 -0500] "GET / HTTP/1.1" 200 33140
"-" "Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:0.9.4) Gecko/20011128
Netscape6/6.2.1"

65.93.183.185 - - [20/Mar/2002:12:41:31 -0500] "GET /includes/style.css
HTTP/1.1" 200 3147 "-" "Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US;
rv:0.9.4) Gecko/20011128 Netscape6/6.2.1"

65.93.183.185 - - [26/Mar/2002:12:41:31 -0500] "GET
/template/images/clear.gif HTTP/1.1" 200 43 "http://www.yahoo.com/";
"Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:0.9.4) Gecko/20011128
Netscape6/6.2.1"

Does anyone have a snippet of code that would accomplish this?

Any assistance always appreciated.

Normand Charette
SuccessInMind.com

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to