Quote:
Originally Posted by
sankasu
here is the log pattern..
Debug eqweb/dbcrm/jsp [Feb 04 05:58:32:209]--><829> <59174E9FF10A03527514777B22CBA902> <TAYRIC> <COMPONENT> Request Parameters: request=page&page=PA100_MyAcc
out here i need to capture the request..
there are two cases here one is where the we get the data imm after the word request (highlighted in red)
for eg we have request=E10 so we capture E10 and for a given user like in this case is TAYRIC we calculate the number of hits..
the second kinda request which also needs to be considered is the above one where the request is actually "PA100_MyAcc"
Hope that explains..lemme know if u need any more details..as i really need this urgently..
Regards,
Sankasu
may be you may want to try this:
# store everything is hash will make your work a lot easier
# Are you are parsing through or reading line by line?
$line = "Debug eqweb/dbcrm/jsp [Feb 04 05:58:32:209]--><829> <59174E9FF10A03527514777B22CBA902> <TAYRIC> <COMPONENT> Request Parameters: request=page&page=PA100_MyAcc"
@arr = split( /\s+/, $line );
# to count hits
$arr[4] =~ /\<\(S+)\>/;
if( defined($count{$1}) ) {
$count{$1}++;
} else {
$count{$1}=1;
}
# last item will be request=page&page=PA100_MyAcc assuming there's no space for this data item
$arr[$#arr] =~ /request=(\S+)&page=(\S+)/;
$req{$1} = $2; #this stores the request name to it's real name
Don't know whether this helps.
~* Dniz *~