Dear monks, I am a Perl newbie and hope you can point me in the right direction. I am writing script, which will look at a certain records in system log files. The problem is that it may need to check the records going up to few days back. By the time of running the check, log files may have already been rotated and archived as bz2 in the same /var/log directory.
What is the most efficient way to "go back in time" and search in these rotated files? Since logs are rotated by size, not date, the script does not know through how many files back it has to look, until it looks inside the file.
Thank you for advice
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|