[Linux-disciples] Color-coding script output
Stephen R Laniel
linux-disciples@bostoncoop.net
Wed, 27 Aug 2003 18:01:08 -0400
I have a little script that runs through my Apache logs and
post-processes them in various ways (removing Nimda and Code Red hits,
changing unresolved IP addresses into English names, etc.). The trouble
is that reading the logs is still not quite as fast as I'd like it to be.
I'd like the referrer to be color-coded one way, the hostname to be
color-coded another, and so forth. So: do you know of any way to take a
raw text file and pipe it through a Perl script, coming out with
context-sensitive highlighting on the other end? The referrer, hostname,
date and so forth are all quite easy to identify with a regex, so that's
not the problem; I just want to know how to change the colors.
Thoughts?
--
``The legacy of `Crazy Uncle Steve' begins here and now, people.''
-Jon Sung