Monitoring Multiple Log Files At A Time With MultiTail On Debian Lenny
Author: Falko Timme
Follow me on Twitter
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 two or even more log files is possible.
I do not issue any guarantee that this will work for you!
1 Installing MultiTail
MultiTail can be installed as follows:
aptitude install multitail
2 Using MultiTail
To watch two logs at the same time, e.g. /var/log/syslog and /var/log/messages, you'd use the following command:
multitail /var/log/syslog /var/log/messages
You should now see two "windows", one for the first log file and the second one for the second log file:
To scroll through one of these log files, type
and select the log file that you want to scroll through:
You can now use the arrow up/arrow down keys to scroll through the file.
will scroll right to the beginning of the file, and
will scroll to the end.
to go back to the previous window.
is also the key that you have to type to leave MultiTail.
You can also merge two or more files into one window, e.g. as follows:
multitail /var/log/apache2/access.log -I /var/log/apache2/error.log
You should then see both log files merged in one window which allows you to track down errors more easily:
It is also possible to watch the output of commands with MultiTail, e.g. as follows:
multitail -R 2 -l "netstat -tap"
This displays the output of the command netstat -tap and refreshes it every two seconds:
This is just a short overview of what you can do with MultiTail. You can find more examples here: http://www.vanheusden.com/multitail/examples.html