Wen has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to read from rotated log file?
by JavaFan (Canon) on Jan 29, 2012 at 21:16 UTC | |
|
Re: How to read from rotated log file?
by johngg (Canon) on Jan 29, 2012 at 23:47 UTC | |
by Wen (Initiate) on Feb 02, 2012 at 05:40 UTC |