Tail Multiple Logs At Once
      by Wyatt WalterI discovered a little trick today that I will probably be using every day. I wasn’t sure exactly which log file I needed to be watching while a coworker was doing some work on a server. There was a lot of log files in a directory and I had no idea what file I was looking for, so I decided to try: “tail -f *.log”. The output was actually very useful. Whenever tail shows output from a different file, it gives you the filename in a tag and shows the output and looked something like this:
tail -f /var/log/*.log
==> /var/log/mail.log <==
Jan 7 23:15:48 apu zmmailboxdmgr[21716]: status requested
Jan 7 23:15:48 apu zmmailboxdmgr[21716]: status OK
==> /var/log/zimbra.log <==
Jan 7 23:15:48 apu zmmailboxdmgr[21716]: status requested
Jan 7 23:15:48 apu zmmailboxdmgr[21716]: status OK
==> /var/log/auth.log <==
Jan 7 23:15:49 apu sudo: zimbra : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/opt/zimbra/libexec/zmmailboxdmgr status
Jan 7 23:15:49 apu sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Jan 7 23:15:49 apu sudo: pam_unix(sudo:session): session closed for user root
Those are some of the Zimbra logs and it shows the filename inbetween ==> and <==. I'd done the same with grep before, but hadn't thought of using tail in that way. You can also select a couple of files by doing something like this:
tail -f log1.log log2.log
Happy log parsing!
Related Posts- Zimbra In an Hour After spending a great deal of time the Zimbra forums...
- Cleaning Up After Safari 4 There's been a few reports in the blogosphere of an...
- Parallels 4 vs. VMware Fusion 2 Parallels recently released version 4 of their desktop virtualization software...
- Oversimplified NFS Server How-To This how-to assumes that both systems are running Ubuntu, although...
- Identifying Authentic Memorabilia One of the most important aspects of collecting any type...
- FOTD AL Spring Solstice Eyes I received AL's Spring Solstice colors a couple of days...
- Working On Transferring Archives From Blogger To Wordpress She says: Just an update. This has been a real...
- Chords 101 pt 2 Continued from pt 1. In contrast, however, Andrew Surmani has...
Tags: linux
Filed under How-Tos / Tips :
Comments (0) :
Jan 8th, 2009


