in reply to Re^2: not getting desired output
in thread not getting desired output

Like I said, the other monks only found some of the problems in your script. Your script counts errors that aren't for "Handling NSPAdvice for mechanism [4]".

For example, for the following log, your script counts two errors and mine counts one:

...Handling NSPAdvice for mechanism [4]... ...Authentication mechanism returned [3]... ...Handling NSPAdvice for mechanism [5]... ...Authentication mechanism returned [3]...

This is a symptom of your inner loop not exiting before the end of the log file (the second bullet in the grandparent post).