Tailing logs
Oliver Fromme
olli at lurza.secnetix.de
Fri Aug 22 15:39:22 UTC 2008
DAve <> wrote:
> I would love to have a way to tail a log, like piping to grep, except I
> see every line and the lines I would normally grep for are highlighted.
> That would be cool. Anyone know of a bash command or tool that will do this?
>
> Side note, I am tailing sendmail after changes to my outbound queue
> runners. I want to highlight my sm-mta-out lines but still see all lines.
You could use this script:
http://www.secnetix.de/olli/scripts/bold
It's a filter that works like similar to grep, but it
highlights the parts that match your regular expression.
The script contains usage information.
So you can do things like this:
$ tail -f /var/log/maillog | bold -l myhost.mydomain
(The -l option specifies to highlight the whole line,
not just the part that matches.)
Best regards
Oliver
--
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart
FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd
"C++ is over-complicated nonsense. And Bjorn Shoestrap's book
a danger to public health. I tried reading it once, I was in
recovery for months."
-- Cliff Sarginson
More information about the freebsd-questions
mailing list