LinuxCommandLibrary

multitail

Monitor multiple log files simultaneously

TLDR

Tail all files matching a pattern in a single stream

$ multitail -Q 1 '[pattern]'
copy

Tail all files in a directory in a single stream
$ multitail -Q 1 '[path/to/directory]/*'
copy

Automatically add new files to a window
$ multitail -Q [pattern]
copy

Show 5 logfiles while merging 2 and put them in 2 columns with only one in the left column
$ multitail -s 2 -sn 1,3 [path/to/mergefile] -I [path/to/file1] [path/to/file2] [path/to/file3] [path/to/file4]
copy

SYNOPSIS

multitail [options] file1 file2 ...

PARAMETERS

-i file
    Add another file to monitor. Can be used multiple times.

-l command
    Execute a command and monitor its output.

-L file
    Monitor input from stdin and redirect it to a file. Useful for logging.

-s N
    Split the screen into N windows vertically. This is the default behavior, and 'N' usually defaults to the number of files being watched, with a maximum of 16.

-sn N
    Split the screen into N windows horizontally, with N indicating the number of split screens.

-I color
    Sets the default color for the specified file. Accepts color names or hexadecimal codes.

-q
    Quiet mode: suppress all warnings.

-h
    Show help message.

-ex "regex"
    Exclude lines matching the regular expression "regex".

-e "regex"
    Highlight lines matching the regular expression "regex".

DESCRIPTION

multitail is a powerful Linux command that allows you to monitor multiple log files (or commands) simultaneously within a single terminal window. It presents the output from each file (or command) in separate, color-coded windows, making it easy to track events across various sources in real-time. This is invaluable for troubleshooting complex systems where information is spread across numerous logs.
multitail can also be used to filter and highlight specific lines based on regular expressions, and it supports various display options to customize the output to your needs. Furthermore, it can monitor remote files over SSH. Compared to simply opening multiple terminal windows, multitail provides a consolidated view and efficient workflow. It is an essential tool for system administrators, developers, and anyone who needs to monitor multiple streams of data concurrently.
Multitail supports highlighting, filtering, and regular expression searches. The command's flexible design can be configured to handle a multitude of complex monitoring scenarios.

MOUSE INTERACTIONS

multitail provides mouse support. Clicking on a window selects it, and scrolling allows you to navigate the output of that particular file. The middle mouse button pastes the current selection from the X clipboard. Furthermore, the mouse can resize windows by clicking and dragging window borders.

REMOTE MONITORING

multitail can monitor remote files using SSH. For example: multitail -i 'ssh user@host tail -f /path/to/log' will monitor a log file on a remote machine. Requires SSH access configured correctly.

SEE ALSO

tail(1), grep(1), less(1)

Copied to clipboard