Thanks for your thoughts. I do have some Perl code that I can include once I can get to it.
Agreed that this was intended more of a problem space solution but with a Perl implementation since my code is in Perl.
As to the specifics, my code runs every 3 minutes and checks the last 5 minutes worth of logs from a DB. Every matching event is then logged to a different table in the DB. Once all events are gathered, the match table is then run through line by line to generate the emails.
I know, rather lazy as I did not think this would blow up and spam e or my engineers. But, now that it has, here we are.
With the input gathered so far, I think I had a couple of thoughts:
- run through the match table at the beginning of the script and store that last matches in a hash for easy lookup later
- aggregate the match table query for the look to get a count of each match in the period, rather than all of them
- For each match in the loop, check the has to make sure it has not been an hour since last detection. If more than an hour, send the email
Any additional thoughts?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.