Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am counting the error code for Mechanism4. But it is not giving me the desired output,instead it prints 0. Here is the snippet of the logfile-my $logFile = $ARGV[0]; die "usage: $0 <logFile>" 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 $ArcotIDError_Count = 0; my $QnAError_Count = 0; my $UPError_Count = 0; my $OTPError_Count = 0; my $errorCode; while(my $line = <$log>) { $n++; $line =~ tr/\r\n//d; if($line =~ /Handling NSPAdvice for mechanism [4]/) { while ( $line = <$log> ) { if ($line =~ /Authentication mechanism returned [[](\S*)[] +]/) { my $errorCode = $1; print $errorCode; if ($errorCode != 0 || $errorCode != 1) { $ArcotIDError_Count++; } } next; } } } print "Total Number Of ArcotID Authentication ErrorCode returned i +s $ArcotIDError_Count\n";
Thanks NTHandle_NSPAdvice:: Handling NSPAdvice for mechanism [4] Fri May 29 18:39:05.217 2009 Morocco Standard Time INFO: pid 3216 t +id 2592: 170: 133090: Handle_NSPAdvice::NSP Action :[NSP_INC] Fri May 29 18:39:05.217 2009 Morocco Standard Time INFO: pid 3216 t +id 2592: 170: 133090: Using Oracle Query Fri May 29 18:39:05.217 2009 Morocco Standard Time INFO: pid 3216 t +id 2592: 170: 133090: NSP Update Query is based on Serial Number Fri May 29 18:39:05.232 2009 Morocco Standard Time INFO: pid 3216 t +id 2592: 17: 133090: ArAuthFrameworkImpl::doPostAuth::11:133088:: Aut +hentication mechanism returned [3] for AuthIdentity [01246825]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: not getting desired output
by ikegami (Patriarch) on Jun 11, 2009 at 15:41 UTC | |
by namishtiwari (Acolyte) on Jun 11, 2009 at 16:06 UTC | |
by ikegami (Patriarch) on Jun 11, 2009 at 17:14 UTC | |
by ikegami (Patriarch) on Jun 11, 2009 at 17:13 UTC | |
by namishtiwari (Acolyte) on Jun 11, 2009 at 16:04 UTC | |
|
Re: not getting desired output
by jwkrahn (Abbot) on Jun 11, 2009 at 15:30 UTC | |
by namishtiwari (Acolyte) on Jun 11, 2009 at 15:46 UTC | |
|
Re: not getting desired output
by Perlbotics (Archbishop) on Jun 11, 2009 at 15:38 UTC | |
|
Re: not getting desired output
by lostjimmy (Chaplain) on Jun 11, 2009 at 15:40 UTC | |
|
Re: not getting desired output
by Marshall (Canon) on Jun 11, 2009 at 22:28 UTC |