[17/May/2005:18:15:59 -0700]sdjhsj USERID=t70xvcy; jdhdh JSESSIONID=0000RDnYTABcRWOx0UN2Zq--sZB:10f408hdg [17/May/2005:18:15:59 -0700]sdjhsj USERID=t70xvcy; jdhdh JSESSIONID=0000RDnYTABcRWOx0UN2Zq--sZB:10f408hdg [17/May/2005:18:15:59 -0700]sdjhsj USERID=t70xvcy; jdhdh JSESSIONID=0000RDnYTABcRWOx0UN2Zq--sZB:10f408g13 #### my $FileName = "test.txt"; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); open ACCESS,"< $FileName" || die "Can't open the file...."; my %User_Lst; while () { if (/:(..):(..):(..).*USERID=([a-z0-9].+; ).*JSESSIONID=([a-z0-9].+)/){ $l_hr=$1; $l_min=$2; $l_sec=$3; $UserID=$4; $session=$5; $UserID=~s/;.*//g; $session=~s/.*://g; $User_Lst{$UserID}=join(":",$l_hr,$l_min,$l_sec); # $User_Lst{$sessionid}=$session; } } my $l_Counter=0; #while ( (($UserID,$sessionid $TStamp) = each (%User_Lst)) and (($sessionid) = each (%Session_Lst))) { while ( ($UserID, $TStamp) = each (%User_Lst)) { print sprintf("Server Name :%s,\t User Name: %s ,\t Time:%s \n", $sessionid, $UserID, $TStamp); $l_Counter++; } close ACCESS;