- blogs:
- cles::blog
2010/03/07

multitailで複数のログを追いかける

ターミナルでログを追いかける際には tail -f を使う人が多いと思います。僕もよく使っています。これまでtailの引数に渡せるファイルは1つだけだと思っていたのですが、実は複数のファイルを指定することもできるようです。ただ、後述のように出力がSTDOUTに統合されてしまうので、双方のファイルに頻繁にログが出力されるような場合にはあまり見やすくありません。
そんなことをtwitterで呟いていたら「@hsur multitailのほうがお勧めですw」と@kon_clが教えてくれたので、早速インストールしてみました。
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.
el5系のRPMについてはDAG: multitail RPM packages for Red Hat, CentOS and Fedoraにあるので、下記の要領でサクッとインストール。使い方も簡単です。
† multitailのインストール
wget http://dag.wieers.com/rpm/packages/multitail/multitail-5.2.1-1.el5.rf.i386.rpm
rpm -ivh multitail-5.2.1-1.el5.rf.i386.rpm
† 参考: tail -f に複数のファイルを渡した場合
$ tail -f foo.log bar.log
==> foo.log <==
foo1
foo2
foo3
==> bar.log <==
bar1
bar2
bar3
bar4
bar5
==> foo.log <==
foo4
==> bar.log <==
bar6
トラックバックについて
Trackback URL:
お気軽にどうぞ。トラックバック前にポリシーをお読みください。[policy]
このエントリへのTrackbackにはこのURLが必要です→https://blog.cles.jp/item/3457
Trackbacks
このエントリにトラックバックはありません
Comments
愛のあるツッコミをお気軽にどうぞ。[policy]
古いエントリについてはコメント制御しているため、即時に反映されないことがあります。
古いエントリについてはコメント制御しているため、即時に反映されないことがあります。
コメントはありません
Comments Form
コメントは承認後の表示となります。
OpenIDでログインすると、即時に公開されます。
OpenID を使ってログインすることができます。
サイト内検索
検索ワードランキング
へぇが多いエントリ
閲覧数が多いエントリ
1 . アーロンチェアのポスチャーフィットを修理(114429)
2 . 福岡銀がデマの投稿者への刑事告訴を検討中(112950)
3 . 年次の人間ドックへ(112376)
4 . 2023 年分の確定申告完了!(1つめ)(111945)
5 . 三菱鉛筆がラミーを買収(111819)
2 . 福岡銀がデマの投稿者への刑事告訴を検討中(112950)
3 . 年次の人間ドックへ(112376)
4 . 2023 年分の確定申告完了!(1つめ)(111945)
5 . 三菱鉛筆がラミーを買収(111819)
cles::blogについて
Referrers