Multi Tail is best Linux utility I found so far this year and I think it’s going to be hard to beat!
With multi tail you can view logs from two different sources and display them in a multi window arrangement. So you think big deal I can do this with multiple terminal windows running… but what if you are running a system without a X-Window envirnoment? I thought so!!
This is very handy for servers that should really not have a Window manager installed and/or if you are sshing in frm another box.
Official details from the site http://www.vanheusden.com/multitail/
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.
As shown below I’m looking at all new TCP connections and their state changes using netstat while in the other window displaying the merged access and error logfiles of apache:
Merge 2 logfiles in one window:
multitail /var/log/apache/access.log -I /var/log/apache/error.log
Show 3 logfiles in 2 columns:
multitail -s 2 /var/log/apache/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/apache/access.log -I /var/log/apache/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/apache/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/apache/access.log -I /var/log/apache/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/apache/access.log -ci red -I /var/log/apache/error.log