logfile-cat - output (cat) file from the last saved position
logfile-cat [ --status=status-directory | --status=status-file ] logfile logfile-cat --help
When processing log files, you want to continue reading where you left out the last time. The logfile-read program uses the Logfile::Read module internally to store the position last seen for the log file and retrieve it upon the subsequent invocation.
The program also handles rotated files -- if the log file was rotated since the last read, it is detected and the rest of the rotated file is read first, before proceeding to the newer rotate file or to the current log file.
The content is printed to the standard output.
The parameter specifies either the status file which is used to store the position, or directory which will hold the status file. The file has to already exist (albeit empty) for the path to be recognized as status file, otherwise it is considered to be a status directory path.
Short usage is printed.
# output data from Apache's access_log logfile-read /var/log/httpd/access_log logfile-read --status /var/run/apache/logfile-read error_log
Copyright (C) 2011 by Jan Pazdziora
This module is free software. You can redistribute it and/or modify it under the terms of the Artistic License 2.0.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
To install Logfile::Read, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Logfile::Read
CPAN shell
perl -MCPAN -e shell install Logfile::Read
For more information on module installation, please visit the detailed CPAN module installation guide.