Grc
Christian Külker
version 0.1.1
2022-05-27
Make logfiles colorful
Table Of Contents

The Python tool grc is very useful to catch problems in logfiles by highlighting certain keywords and sections. It generic colourize text and can be used to colourize logfiles and output of commands. It comes with a set of pre configured expressions and it can be configured via additional regular expressions.

Installation

aptitude install grc

Usage

Simplest:

grc netstat
grc ping hostname
grc tail /var/log/syslog
grc ps aux

Simple:

grc tail -f /var/log/apache2/error.log

Advanced:

Without grc:

tail -f myfile.log | perl -pe 's/SEVERE/\e[1;31m$&\e[0m/g'

And with grc for the first time:

mkdir ~/.grc
echo "regexp=SERVERE" > ~/.grc/myfile
echo "color=red" >>  ~/.grc/myfile
grc -c myfile tail -f myfile.log

And with grc for the second time and all times:

grc -c myfile tail -f myfile.log

History

Version Date Notes
0.1.1 2022-05-27 Update for Debian 11 Bullseye, 9.13 Stretch, change
shell to bash, +History, Link to tail, +commands
0.1.0 2020-12-17 Initial release