Hi, This is my piece of code-
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";
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-
Handle_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]
Thanks NT

In reply to not getting desired output by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.