cet - console emphasis tool
Version 2.02
cet.pl REGEX1 [COLOR1] [REGEX2 [COLOR2]] ... [REGEXn [COLORn]]
cet.pl is a command line tool for visually emphasizing text in log files etc. by colorizing the output matching regular expressions.
REGEX is any regular expression recognized by Perl. For some shells this must be enclosed in double quotes ("") to prevent the shell from interpolating special characters like * or ?.
COLOR is any ANSI color string accepted by Term::ANSIColor, such as 'green' or 'bold red'.
Any number of REGEX-COLOR pairs may be specified. If the number of arguments is odd (i.e. no COLOR is specified for the last REGEX) cet.pl will use 'bold yellow'.
Overlapping rules are supported. For characters that match multiple rules, only the last rule will be applied.
In a system log, emphasize the words "error" and "ok":
tail -f /var/log/messages | cet.pl error red ok green
In a mail server log, show all email addresses between <> in white, successes in green:
tail -f /var/log/maillog | cet.pl "(?<=\<)[\w\-\.]+?\@[\w\-\.]+?(?=\>)" "bold white" "stored message|delivered ok" "bold green"
In a web server log, show all URIs in yellow:
tail -f /var/log/httpd/access_log | cet.pl "(?<=\"get).+?\s"
Multi-line matching is not implemented.
All regular expressions are matched without case sensitivity.
Nothing. You should not attempt to use this module for anything. Perhaps what you are really looking for is the script: cet
Andreas Lund, <floyd@atc.no>, C Hutchinson, <taint@cpan.org>
C Hutchinson taint at cpan.org
taint at cpan.org
Please report any bugs or feature requests to bug-cet at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=cet. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-cet at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc cet
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=cet
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/cet
CPAN Ratings
http://cpanratings.perl.org/d/cet
Search CPAN
http://search.cpan.org/dist/cet/
Copyright 2009-2013 Andreas Lund Copyright 2013 C Hutchinson
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install cet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm cet
CPAN shell
perl -MCPAN -e shell install cet
For more information on module installation, please visit the detailed CPAN module installation guide.