The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

prefix - prefixes hostname time information or more to lines from stdin (or read from files)

SYNOPSIS

    % tail -f /var/log/some.log | prefix -host -timestamp 

tails a file, showing each line with a hostname and a timestamp like. So if we were tailing a growing file with lines like:

    OK: System operational
    Warning: Disk bandwidth saturated

we would get real-time output like:

    arachnid.example.com 2013-10-13 16:55:49 Warning: Things are wonky: disks spinning backwards
    arachnid.example.com 2013-10-13 16:55:50 Error: Data read wackbards
    arachnid.example.com 2013-10-13 16:56:10 OK: Spacetime reversal complete

Note that the hostname (arachnid.example.com) and the date have been prepended.

See options below for more details.

DESCRIPTION

A text filter that prepends (or appends) data to lines read from stdin or named files, and echos them to stdout

OPTIONS

--text='arbitrary text here'

add any particular string you like.

--timestamp

Add a timestamp

--utimestamp

Add a timestamp, showing fractions of a second

--hoststamp

Add the hostname

--no-space

Don't put a space between the original line read and the data added

--suffix

Show added data at end of line, not start of line

--elapsed

Show time elapsed since last line seen

--quote

Show each original line read in single quotes

AUTHOR

Josh Rabinowitz <joshr>