I want to look at multiple log files and correlate the messages in each based on x minute intervals. This is in an effort to trouble shoot an issue. My initial thoughts are to create a hash with a descriptive name for a log as the key, and then the value being an array with the path to log file and a place to put a reg ex to match the date. (Unfortunately, the logs to not use the same formatting.) Ex:
$hash{apache_access} = ('/path/to/apache_access.log', "^\d\d\/\w\w\w\/\d\d\d\d\:\d\d\:\d\d:\d\d");
What i am looking for is an efficient way to coordinate the error messages from different logs in to one data structure and either print that to the screen or dump it to a file. I am worried about the size of the structure, as it could potentially get very large very fast since I will be looking at approximately 7 log files (including switch and firewall logs) for about a 4 hour period on 1 minute intervals. Any suggestions would be much appreciated.

In reply to Correlating Log files by bsimonds

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.