#!/usr/bin/perl print "Hello, World...\n"; my $logFile = $ARGV[0]; die "usage: $0 " unless $logFile; die "Logfile $logFile doesn't exist" unless -f "$logFile"; open(my $log, "<", $logFile) or die "Can't open $logFile for reading."; print "Processing file $logFile...\n"; #my $authenticates = {}; my $n = 0; my $Time_Stamp ; my $User_Name; my $Success; my $Failure; my $ErrorCode; my $ErrorMsg; while(my $line = <$log>) { $n++; $line =~ tr/\r\n//d; if ($line =~ /^(.*)INFO:.*recvd AA_BIN_MSG_GET_WLT/) { $Time_Stamp = $1; while ( $line = <$log> ) { if ($line =~ /recvd AA_BIN_MSG_VER_CHG$/) { while ( $line = <$log>) { if ($line =~ /Cert.*UserID=(\d+)/) { $User_Name = $1 ? $1 : "NULL" ; } } while ( $line = <$log> ) { if ($line =~ /ArcotID Auth SUCCESS/) { $Success = "Success"; } } while ( $line = <$log> ) { if ($line =~ /Auth fail due to signature verification/) { $Failure = "Failure"; } } while ( $line = <$log> ) { if ($line =~ /Authentication mechanism returned \[(\d+)\]/) { $ErrorCode = $1; } } while ( $line = <$log>) { if ($line =~ /(Auth fail due to signature verification.)/) { $ErrorMsg = $1 ? $1 : "Null"; } } }print "$Time_Stamp , $User_Name , $Success , $Failure , $ErrorCode , $ErrorMsg \n"; next; } } }