in reply to wrong output

When I ran your code with the snippet of the logfile you provided I got the following in temp12:

Tue May 19 22:55:13.649 2009 Morocco Standard Time ,Success,12345, 0, +null

which seems to be ok to me

Replies are listed 'Best First'.
Re^2: wrong output
by namishtiwari (Acolyte) on Jul 02, 2009 at 08:47 UTC
    Yes that is the expected output according to the snippet, but for me it is not showing anything in the output file. I am puzzled what wrong i am doing. Thanks NT
Re^2: wrong output
by namishtiwari (Acolyte) on Jul 02, 2009 at 11:03 UTC
    Hi, Actually my concern here is that the total output for QnA mismatches with the result of this code. I have a diffrent code that gives me the total count. I ran both the scripts on 6 logfiles, but for one the total no is 325 and for the above script is only 70, so there is big mismatch. If anyone can suggest anything regarding this by watching my code, then it will be great. Thanks NT

      The problem that you don't see anything in temp12 should not have anything to do with the perl program. Maybe you are looking into the wrong temp12 file. Check the directory listing. When you are writing to a file at a specific time the file must have that excact time in the directory listing. If not you are looking at a different file or a file you can't write to.

      About your concern: It was already suggested to you that your script will not find (multi line) log entries that start while a previous (mulit line) log entry isn't finished. Suggested remedies were to only look for the success and failure lines or keep a hash of entries so that you can work on more than one (multi line) log entry at the same time. Did you check if this is the case?

      To find out what is happening in your program, find the first log entry that should have been found but wasn't. Then copy the log file and edit the copy so that that specific log entry is at the start of the log file. If the log entry is found now, you know that previous log entries prevented this from being seen (quite probably the problem I mentioned above). If it still isn't found, use the perl debugger and single step through the code. Or use print statements to find out where the script diverts from your expectation

      So what convinces you that the "diffrent code that gives (you) the total count" is correct?

      It's hard to respond to such an assertion without knowing the "diffrent code" (sic).