ccze is a wonderful tool that brings real joy to the arduous task of reading or searching thru log files. It uses a modular approach to support custom colour formatting for popular applications such as Apache, Postfix, Exim, etc.
Install ccze on CentOS and Fedora linux
First enable Epel repository and run following command:
- # yum install ccze -y
Install ccze on Debian/Ubuntu linux
On Debian/Ubuntu, you can use apt-get to install:
- ~$ sudo apt–get install ccze –y
How to use ccze tool
ccze colourises logs that are sent to standard out, for example, we can use tailf to follow a log file and then prettify the output by piping to ccze, examples:
- ~$ tail /var/log/syslog | ccze –A
Export log files to html file using ccze tool:
- ~$ cat /var/log/syslog | ccze –h >~/Desktop/syslog.html
Example:
This tool comes with plenty of options. You can customize it more in these files
- /etc/cczerc, $HOME/.cczerc
To see list of plugins available just do
- $ ccze –l
Example output:
- ~$ ccze –l
- Available plugins:
- Name|Type|Description
- ————————————————————
- apm |Partial|Coloriserfor APM sub–logs.
- distcc |Full|Coloriserfor distcc(1) logs.
- dpkg |Full|Coloriserfor dpkg logs.
- exim |Full|Coloriserfor exim logs.
- fetchmail |Partial|Coloriserfor fetchmail(1)sub–logs.
- ftpstats |Full|Coloriserfor ftpstats (pure–ftpd) logs.
- httpd |Full|Coloriserfor generic HTTPD access and error logs.
- icecast |Full|ColoriserforIcecast(8) logs.
- oops |Full|Coloriserfor oops proxy logs.
- php |Full|Coloriserfor PHP logs.
- postfix |Partial|Coloriserfor postfix(1)sub–logs.
- procmail |Full|Coloriserfor procmail(1) logs.
- proftpd |Full|Coloriserfor proftpd access and auth logs.
- squid |Full|Coloriserfor squid access, store and cache logs.
- sulog |Full|Coloriserfor su(1) logs.
- super|Full|Coloriserforsuper(1) logs.
- syslog |Full|Generic syslog(8) log coloriser.
- ulogd |Partial|Coloriserfor ulogd sub–logs.
- vsftpd |Full|Coloriserfor vsftpd(8) logs.
- xferlog |Full|Generic xferlog coloriser.
For more ccze optioins see man pages.