{"id":430,"date":"2009-10-13T09:24:37","date_gmt":"2009-10-13T09:24:37","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/index.php\/?p=430"},"modified":"2009-10-13T09:24:37","modified_gmt":"2009-10-13T09:24:37","slug":"installing-multitail","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/installing-multitail\/","title":{"rendered":"Installing Multitail"},"content":{"rendered":"<p><category><\/category><br \/>\nFrom ghacks.net<br \/>\nThe easiest way to install multitail is to issue the command (since you\u2019ll be working in the command line anyway):<br \/>\nsudo apt-get install multitail<br \/>\nor<br \/>\nyum install multitail<\/p>\n<p>Once the application is installed you are ready to go (there is no configuration necessary).<\/p>\n<p>Running multitail<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>The structure of the multitail command is:<\/p>\n<p>multitail -i FIRSTLOG -i SECONDLOG<\/p>\n<p>Where FIRSTLOG and SECONDLOG are the log files you want to follow. Sticking with the example above let\u2019s follow mail.err and mail.info. We do this with the command:<\/p>\n<p>sudo multitail -i \/var\/log\/mail.err -i \/var\/log\/mail.info<\/p>\n<p>The above command will have multitail following both log files horizontally (as shown in Figure 1). At first it can be a bit disconcerting to see and follow. What you are seeing is the \/var\/log\/mail.err file being tail\u2019d on top and the \/var\/log\/mail.info file being tail\u2019d on bottom. The easiest way to discern one from the other is at the bottom of each tail is the white bar showing what file is being tail\u2019d.<\/p>\n<p>If you do not like the horizontal layout you can change that to a vertical layout with the s switch like so:<\/p>\n<p>sudo multitail -s 2 -i \/var\/log\/mail.err -i \/var\/log\/mail.info<\/p>\n<p>When you run this version of the command the tail\u2019s are side by side with a wide vertical bar between them (as you can see in Figure 2).<\/p>\n<p>Merging logs<br \/>\n&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>You can also use multitail to merge multiple logs into one log. This can help you when you know you need to follow the output of more than one log file but you don\u2019t need them separated. To do this you use the mergeall option like so:<\/p>\n<p>sudo multitail \u2013mergeall -i \/var\/log\/mail.err -i \/var\/log\/mail.info<\/p>\n<p>For more information;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nhttp:\/\/www.vanheusden.com\/multitail\/index.html<\/p>\n<p>Examples<br \/>\n&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p># Merge 2 logfiles in one window:<\/p>\n<p>multitail \/var\/log\/apache\/access.log -I \/var\/log\/apache\/error.log<\/p>\n<p># Show 3 logfiles in 2 columns:<\/p>\n<p>multitail -s 2 \/var\/log\/apache\/access.log \/var\/log\/messages \/var\/log\/mail.log<\/p>\n<p># Show 5 logfiles while merging 2 and put them in 2 columns with only one in the left column:<\/p>\n<p>multitail -s 2 -sn 1,3  \/var\/log\/apache\/access.log -I \/var\/log\/apache\/error.log \/var\/log\/messages \\<br \/>\n                        \/var\/log\/mail.log \/var\/log\/syslog<\/p>\n<p># Merge the output of 2 ping commands while removing &#8220;64 bytes received from&#8221; from only 1 of them:<\/p>\n<p>multitail -l &#8220;ping 192.168.0.1&#8221; -ke &#8220;64 bytes from&#8221; -L &#8220;ping 192.168.0.2&#8221;<\/p>\n<p># Show the output of a ping-command and if it displays a timeout, send a message to all users<br \/>\ncurrently logged in<\/p>\n<p>multitail -ex timeout &#8220;echo timeout | wall&#8221; -l &#8220;ping 192.168.0.1&#8221;<\/p>\n<p># In one window show all new TCP connections and their state changes using netstat while in<br \/>\nthe other window displaying the merged access and error logfiles of apache<\/p>\n<p>multitail -R 2 -l &#8220;netstat -t&#8221; \/var\/log\/apache\/access.log -I \/var\/log\/apache\/error.log<\/p>\n<p># As the previosu example but also copy the output to the file netstat.log<\/p>\n<p>multitail -a netstat.log -R 2 -l &#8220;netstat -t tcp&#8221; \/var\/log\/apache\/access.log -I \/var\/log\/apache\/error.log<\/p>\n<p># Show 2 logfiles merged in one window but give each logfile a different color so that you<br \/>\ncan easily see what lines are for what logfile:<\/p>\n<p>multitail -ci green \/var\/log\/apache\/access.log -ci red -I \/var\/log\/apache\/error.log<\/p>\n<p># Show 3 rssfeeds merged in one window using rsstail<\/p>\n<p>multitail -cS rsstail -l &#8220;rsstail -n 1 -z -l -d -u http:\/\/setiathome.berkeley.edu\/rss_main.php&#8221; \\<br \/>\n\t-cS rsstail -L &#8220;rsstail -n 1 -z -l -d -u http:\/\/www.biglumber.com\/index.rss&#8221; -cS rsstail \\<br \/>\n\t-L &#8220;rsstail -n 1 -z -l -u http:\/\/kernel.org\/kdist\/rss.xml&#8221;<\/p>\n<p># Show a Squid (proxy server) logfile while converting timestamps to something readable<\/p>\n<p>multitail -cv squid \/var\/log\/squid\/access.log<\/p>\n<p># Display Q-Mail logging while converting the timestamp into human readable format<\/p>\n<p>multitail -cv qmailtimestr \/var\/log\/qmail\/qmail.smtpd.log<\/p>\n<p># Merge ALL apache logfiles (*access_log\/*error_log) into one window:<\/p>\n<p>multitail -cS apache &#8211;mergeall \/var\/log\/apache\/*access_log &#8211;no-mergeall -cS apache_error \\<br \/>\n\t&#8211;mergeall \/var\/log\/apache\/*error_log &#8211;no-mergeall<\/p>\n<p># Monitor the logfile of an other system:<br \/>\nFor this you need to setup a couple of things. MultiTail runs on system A, the logfile on system B.<br \/>\nIn this example we&#8217;re going to monitor the apache logfile. Add the following to \/etc\/services:<\/p>\n<p>apachelog       20000\/tcp<\/p>\n<p>Add this to \/etc\/inetd.conf:<\/p>\n<p>apachelog stream tcp nowait root \/usr\/local\/sbin\/tail_apache_log \/usr\/local\/sbin\/tail_apache_log<\/p>\n<p>and create the file \/usr\/local\/sbin\/tail_apache_log with the following content:<\/p>\n<p>#!\/bin\/sh<\/p>\n<p>\/usr\/bin\/tail -f \/var\/log\/apache2\/access.log<\/p>\n<p>make sure that you don&#8217;t forget to make that script executable (chmod +x filename).<br \/>\nThen on host A start MultiTail like this:<\/p>\n<p>multitail -cS apache -l &#8220;telnet B 20000&#8221;<\/p>\n<p>Please note that logfiles go in plaintext across the network. You may also need to adjust<br \/>\nthe files \/etc\/hosts.[allow|deny] on host B to only allow host A to connect.<br \/>\n# Monitoring Tomcat<\/p>\n<p>multitail -cS apache -cS log4j &#8220;${TOMCAT_HOME}\/logs\/catalina.out&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>From ghacks.net The easiest way to install multitail is to issue the command (since you\u2019ll be working in the command line anyway): sudo apt-get install multitail or yum install multitail Once the application is installed you are ready to go (there is no configuration necessary). Running multitail &#8212;&#8212;&#8212;&#8212;&#8212;&#8211; The structure of the multitail command is:&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/installing-multitail\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-430","post","type-post","status-publish","format-standard","hentry","category-info"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Installing Multitail - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/installing-multitail\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Installing Multitail - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"From ghacks.net The easiest way to install multitail is to issue the command (since you\u2019ll be working in the command line anyway): sudo apt-get install multitail or yum install multitail Once the application is installed you are ready to go (there is no configuration necessary). Running multitail &#8212;&#8212;&#8212;&#8212;&#8212;&#8211; The structure of the multitail command is:... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/installing-multitail\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2009-10-13T09:24:37+00:00\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/installing-multitail\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/installing-multitail\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"Installing Multitail\",\"datePublished\":\"2009-10-13T09:24:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/installing-multitail\\\/\"},\"wordCount\":868,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"articleSection\":[\"General Info\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/installing-multitail\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/installing-multitail\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/installing-multitail\\\/\",\"name\":\"Installing Multitail - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"datePublished\":\"2009-10-13T09:24:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/installing-multitail\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/installing-multitail\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/installing-multitail\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Installing Multitail\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Installing Multitail - Linux Shtuff","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/g33kinfo.com\/info\/installing-multitail\/","og_locale":"en_US","og_type":"article","og_title":"Installing Multitail - Linux Shtuff","og_description":"From ghacks.net The easiest way to install multitail is to issue the command (since you\u2019ll be working in the command line anyway): sudo apt-get install multitail or yum install multitail Once the application is installed you are ready to go (there is no configuration necessary). Running multitail &#8212;&#8212;&#8212;&#8212;&#8212;&#8211; The structure of the multitail command is:... Read More","og_url":"https:\/\/g33kinfo.com\/info\/installing-multitail\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2009-10-13T09:24:37+00:00","author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/installing-multitail\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/installing-multitail\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"Installing Multitail","datePublished":"2009-10-13T09:24:37+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/installing-multitail\/"},"wordCount":868,"commentCount":0,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"articleSection":["General Info"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/g33kinfo.com\/info\/installing-multitail\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/installing-multitail\/","url":"https:\/\/g33kinfo.com\/info\/installing-multitail\/","name":"Installing Multitail - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"datePublished":"2009-10-13T09:24:37+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/installing-multitail\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/installing-multitail\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/installing-multitail\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"Installing Multitail"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=430"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/430\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}