No, my solution would make a logical AND every 5 minutes. I'll elaborate:

At 17:20 your program would get called and would read in a small file (lets call it /tmp/last). In that file would be stored
1) a file positon from tell
2) two boolean values for the time slot 16:50 to 16:55 (note the difference to above)
3) two boolean values for the time slot 16:55 to 17:00
...
6) two boolean values for the time slot 17:10 to 17:15

Now your program would open the logfile, seek to the file position from 1), read the logfile from there and calculate the two boolean values (is there a success line? is there a non-zero value ?). This would be the result for time slot 17:15 to 17:20

Now the program can calculate the endresult for the half hour by ANDing the values from 2) to 6) and the newly calculated values.

Finally the program overwrites /tmp/last and stores the following into it:
1) the file position from tell
2) two boolean values for the time slot 16:55 to 17:00
2) two boolean values for the time slot 17:00 to 17:05
...
6) the newly calculated boolean values for the time slot 17:15 to 17:20

After 5 minutes your program gets called and does all of the above again. The temporary file is like a pipeline storing only the last 5 results, shifting out an old one and getting a new one.


In reply to Re^3: Parsing a specific section of a log file by jethro
in thread Parsing a specific section of a log file by vxp

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.