Uh-oh, my chastened alarm is starting to buzz loudly!!! LOL. I think the both of you have some very good points and maybe that I haven't thought it through all the way. I did try to make this program so it would be non-system intensive...

My original instructions were to create a deamon that would continually scan the most current last line of seven database log files. Said databases are accessed continously and rather heavily. The entries to the logs are made as they occur, not really on a timed basis. I basicly want to proccess each new last line as it is generated and scrape only that new line for possible error codes. One of the requirements is that logdbd not miss any new last lines. By putting the scrape into an endless loop like that I thought I would be getting as close to real time error reporting as the cpu scheduler would allow, without having to scrape through the entire file to find the error on the last line. The sleep at the end is to give the operator some time to resolve the problem without flooding the system with emails, otherwise this daemon would keep sending messages every 100 microseconds until the message changed ( talk about resources!!! ). The regular expressions are there because the bulk of logfile entries are uninteresting and it's easier (and faster) to eliminate what I don't want to see then to look for the many errors I do find "interesting".

My manager and I had discussed the two ways to do this, my way and his, which was to create 1 single threaded proccess that sequentually checked last line on every database. I felt that I would not be meeting the instant reporting always "on" requirement that was being asked of us to deliver (what mesages might I be missing in log-1 while I cycled through log-50 thru log-100?. I really just want to get this thing working on ten logfiles so I can benchmark it and then write it his way and benchmark that.

I thank you for your input and am eager for any suggestions you might make in regards to this thought proccess. I am still new to this language and may be trying to misapply it in some manner here. Please let me know.
Thanks,
Pat

In reply to Re: Creating a Deamonized Log Scraper by Anonymous Monk
in thread Creating a Deamonized Log Scraper by quasimojo321

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.