February 6, 2015

Colorize Your Logs With Rainbow

If you are tired of digging information from long monotone logs, then I suggest you to colorize them with Rainbow.

It's very simple tool (written in python), that basically colorizing (and do some other formatting too) any output that you can get: tail, less, vi, ping, ... .

Plain boring tail output:

Same output with rainbow parameter --red='.*ERROR.*', which means color all text red that matches regular expression .*ERROR.*:

One more example: --blue='irina' (make all mentions about me blue):

With rainbow you can also make config files, where you can describe how you want to process some file. Here is a simple configuration file:
And here is output with this configuration:

I've tried many different tools for colorizing logs and rainbow seems the best for me: it's very simple (you don't need to learn new syntax), it can work both individually and with configuration files, it works with any output that I need to make.

No comments:

Post a Comment