Monitoring Multiple Log Files At A Time With MultiTail On Debian Lenny

Want to support HowtoForge? Become a subscriber!
 
Submitted by falko (Contact Author) (Forums) on Fri, 2009-08-14 18:44. :: Debian | Monitoring

Monitoring Multiple Log Files At A Time With MultiTail On Debian Lenny

Version 1.0
Author: Falko Timme <ft [at] falkotimme [dot] com>
Follow me on Twitter
Last edited 08/06/2009

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

b

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.

gg

will scroll right to the beginning of the file, and

G

will scroll to the end.

Type

q

to go back to the previous window.

q

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

 

3 Links


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.