#!/usr/bin/perl # takes a web log and prints out the clientID and the time in unix format # Author: Ian Hickman # initialise use strict; use Time::Local; my @field; my ($sec, $min, $hour, $day, $month, $year ); my $time; # loop through all records while( ){ @field=split; $_=$field[3]; # match time stamp ($day, $month, $year, $hour, $min, $sec)=/.(\d\d).(\w+).(\d{4}).(\d\d).(\d\d).(\d\d)/; $time=timelocal( $sec, $min, $hour, $day, $month, $year ); # output clientID and unix time print"$field[0] $time\n"; }