Is there any tool that does both, colorize and filtering lines to suppress form output by regex?

link|improve this question
Cleaned out the comments-posted-as-answers. You'll have to resolve your browser isssue. – Kara Marfia Oct 10 '10 at 3:06
feedback

4 Answers

I tend to use a combination of tail, grep and ccze.

For example,

tail -f /var/log/messages | grep foo | ccze

link|improve this answer
feedback

multitail does exactly what you're asking for and a whole lot more inside an ncurses interface.


multitail (at least on Ubuntu 10.04) ships with a well populated sample config file that will provide nice coloring on most system logs out of the box. A simpler quick-start version of a multitailrc would look like this:

defaultcscheme:foo

colorscheme:foo:all my foo messages
cs_re_s:red,white,bold/blink:([^:]*): says foo!
cs_re:green:.*: says foo!
cs_re:cyan:.*: says bar

# filter out the baz lines with this filterscheme
filterscheme:foo:gets rid of the baz
rule:ev:.*: says baz

usefilterscheme:foo:/var/log/foo

Both cs_re and cs_re_s have a similar format:

cs_re:FG_COLOR[,BG_COLOR[,ATTRIBUTE[/ANOTHER_ATTRIBUTE]]]:REGEX

cs_re_s will colorize only the substrings (things in parentheses).

This should get you started with multitail. If you want to get more fancy, take a look through the sample one provided with it and/or the docs.

link|improve this answer
feedback

You can pipe tail to grep to suppress line output with regex.

tail input.txt | grep -v -e regex_pattern

Grep can alternatively colorize the parts that match the regex, makes finding a pattern in a log file easier.

Colorizing it by regex might be interesting though.

link|improve this answer
feedback

Lots - is google down again? mtail, colortail, multitail...

link|improve this answer
What search string to you type into google to get those answers? What are the advantages / disadvantages of each? This is a completely valid question for this site. – rjmunro Mar 31 '11 at 8:05
feedback

Your Answer

 
or
required, but never shown