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.
1.9-11.11.3-11.11.3-1.1aptitude install grc
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
The README.markdown document on github has more info on this.
For other uses of coloring logfiles see tail and multitail.
| 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 |