Multitail – view multiple logfiles windowed on console

Sponsored Link
MultiTail lets you view one or multiple files like the original tail program. The difference is that it creates multiple windows on your console (with ncurses). It can also monitor wildcards: if another file matching the wildcard has a more recent modification date, it will automatically switch to that file. That way you can, for example, monitor a complete directory of files. Merging of 2 or even more logfiles is possible. It can also use colors while displaying the logfiles (through regular expressions), for faster recognition of what is important and what not. It can also filter lines (again with regular expressions). It has interactive menus for editing given regular expressions and deleting and adding windows. One can also have windows with the output of shell scripts and other software. When viewing the output of external software, MultiTail can mimic the functionality of tools like ‘watch' and such.

Install Multitail in Ubuntu

sudo aptitude install multitail

This will complete the installation.

Multitail Examples

No examples of coloring are given as that is configurable via the onfiguration file. Also for mostcommonly used files color schemes have already been designed.

  • Merge 2 logfiles in one window:

multitail /var/log/apache2/access.log -I /var/log/apache2/error.log

  • Show 3 logfiles in 2 columns:

multitail -s 2 /var/log/apache2/access.log /var/log/messages /var/log/mail.log

  • 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 /var/log/apache2/access.log -I /var/log/apache2/error.log /var/log/messages \ /var/log/mail.log /var/log/syslog

  • Merge the output of 2 ping commands while removing "64 bytes received from" from only 1 of them:

multitail -l "ping 192.168.0.1" -ke "64 bytes from" -L "ping 192.168.0.2"

  • Show the output of a ping-command and if it displays a timeout, send a message to all users currently logged in

multitail -ex timeout "echo timeout | wall" -l "ping 192.168.0.1"

  • In one window show all new TCP connections and their state changes using netstat while in the other window displaying the merged access and error logfiles of apache

multitail -R 2 -l "netstat -t" /var/log/apache2/access.log -I /var/log/apache/error.log

  • As the previosu example but also copy the output to the file netstat.log

multitail -a netstat.log -R 2 -l "netstat -t tcp" /var/log/apache2/access.log -I /var/log/apache2/error.log

  • Show 2 logfiles merged in one window but give each logfile a different color so that you can easily see what lines are for what logfile:

multitail -ci green /var/log/apache2/access.log -ci red -I /var/log/apache2/error.log

  • Show a Squid (proxy server) logfile while converting timestamps to something readable

multitail -cv squid /var/log/squid/access.log

  • Display Q-Mail logging while converting the timestamp into human readable format

multitail -cv qmailtimestr /var/log/qmail/qmail.smtpd.log

Sponsored Link

Related posts

You may also like...

Leave a Reply

Your email address will not be published.