Watch or Monitor Multiple Log Files in Real Time at once in Linux

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

In the following article, I illustrate several common use cases of multitail command to Monitor Multiple Log Files in real taime.

1. Monitor multiple log files as they grow in horizontally-split screens.

The terminal screen will automatically be split into the number of log files specified.

$ sudo multitail --follow-all /var/log/auth.log /var/log/kern.log /var/log/syslog

2. Monitoring log files as they grow in vertically-split screens.

Use “-s N” option to vertically split the screen into N columns.

$ sudo multitail -s 3 --follow-all /var/log/auth.log /var/log/kern.log /var/log/syslog

3. Monitor command outputs simultaneously

Besides tailing log files, multitail can also monitor the output of an external command whiles the execution of the command is in progress. For this, use “-l "command-to-run"” option. For example, you can run multiple ping commands, and monitor individual ping outputs simultaneously in split screens as follows.

$ multitail -l "ping twitter.com" -l "ping google.com"

Conclusion:

In this article, we showed how to watch data being appended in log files in real-time on the terminal in Linux. 

More info

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
Sajid Ali
Sajid Ali
Linux & Windows Server Administrator | Cloud Architect: I possess 10 years of professional experience with administration of different hosting provider’s Linux and Windows based servers on a large production level.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook