List by Time (LBT)

lbt-1.0
By Steve Coile <scoile@patriot.net>

Contents

Summary

This Perl program will filter log file entries according to date preferences.  The utility recognizes a variety of log file formats commonly found on RHL systems.

Requirements

In order to make use of this program, you will need to have Perl 4 or higher installed.  Red Hat Linux 4 systems should be using the perl-5.003-8 package provided by Red Hat Software (available as an update for 4.1 and 4.0).

Installation

In order to use this program, download the following file and place it in the /usr/local/bin directory:

http://www.patriot.net/users/scoile/isp-redhat/log-processing/lbt-1.0

If you have Lynx installed, the following commands will download the file and place it in the proper location:

SOURCE="http://patriot.net/~scoile/isp-redhat/log-processing/lbt-1.0"
TARGET="/usr/local/bin/lbt"
lynx -source "$SOURCE" > "$TARGET"

After placing the file in /usr/local/bin, change the permissions to allow execution:

chmd a+rx /usr/local/bin/lbt

Configuration

No configuration is necessary.

Operation

lbt accepts a log file via standard input, locates the date/time reference in each line, and outputs only those lines that fall within given time parameters.  Date/time specifications are recognized by their positions within the log entry.  The lbt utility recognizes several log file formats in common use and knows where to find dates/times within them.  Log file formats may be selected with the "-f" switch.

Additional information on command line options is available by invoking lbt with the "-h" switch.

History

When processing log files, you may run into occasions where you want to process a live log file, but you don't want to truncate that file.  If you then want to process the same file again in the future (to catch changes since the last processing), you need to be able to cull only those entries that occur after the last processing.  The lbt utility was designed to accomodate this need.