From 275eb981c67881ec18d214e86ee6fa6d494c71c2 Mon Sep 17 00:00:00 2001 From: Mikko Ahlroth Date: Fri, 5 Jul 2013 11:22:58 +0300 Subject: [PATCH] Better documentation --- readme.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index ad02980..bdad646 100644 --- a/readme.md +++ b/readme.md @@ -1,8 +1,18 @@ php-multitail is a small utility script to tail a bunch of files and display the results compactly. I wrote it because I thought tail's builtin output format for multiple -files was unusable. +files was unusable. The utility launches a tail (or whatever you configure) process for each input file and reads their output until it is killed. Each line is prepended +with the filename's first part with '.' as a delimiter, so 'foo.access.log' turns into 'foo'. Example output from my server logs: ooo: 217.69.133.68 - - [05/Jul/2013:00:51:25 +0300] "GET /robots.txt HTTP/1.0" 302 0 "-" "Mozilla/5.0 (compatible; Linux x86_64; Mail.RU_Bot/2.0; +http://go.mail.ru/help/robots)" stuff: 66.249.75.31 - - [05/Jul/2013:04:11:08 +0300] "GET /robots.txt HTTP/1.1" 404 47 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" stuff: 66.249.75.31 - - [05/Jul/2013:04:11:08 +0300] "GET / HTTP/1.1" 403 135 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" + +Usage: + + php multitail.php /path/to/log/file/or/files + +You can also use glob patterns. I use it like this: + + php multitail.php /var/log/nginx/*.access.log +