in reply to problem in output
As we don't know what the input looks like, we can only guess. One problem I see: Your code assumes that between a transaction (between 'Entering xxx' and 'xxx SUCCESS' or 'XXX FAILED') no other transaction can insert lines into the logfile or it would not be counted. In most cases I know this is not true. In other words: if you step over an interleaved 'Entering yyy' while looking for a 'XXX' success or failure it doesn't get counted
To solve this you could just count SUCCESS and FAILURE lines. You don't seem to do anything with the 'Entering' lines, so why bother?
If that is not a good idea (because of integrity or security concerns) you would have to use a hash or something to remember which 'Entering' lines you already encountered
BTW in lines like if ($line =~ /OTP SUCCESS.*/) the .* is useless and can be dropped without changing anything. Regexes look for string parts if you don't anker them with ^ or $
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: problem in output
by Marshall (Canon) on Jun 29, 2009 at 16:44 UTC |