*nice* maillog output

Scot L. Harris webid at cfl.rr.com
Tue Jun 22 20:11:17 UTC 2004


On Tue, 2004-06-22 at 15:25, Craig Tinson wrote:
> this is probably asking a bit much.. but no harm in asking..
> 
> I currently have a spare 14" monitor connected to the mail server so I 
> can monitor whats going on..
> 
> it is permanently running the following:
> 
> tail -f /var/log/maillog | grcat conf.log

> this is more info than I need and just clutters up (and wraps around) on 
> the 14" monitor..
> 
> is there an obvious/easy way to trim it.. for example:
> 
> Jun 22 - (20:19:26) Mail From: <someone at somedomain.com> to 
> <craig at 8010.co.uk> (Clean)
> Jun 22 - (20:20:30) Mail From: <someone at somedomain.com> to 
> <craig at 8010.co.uk> (Spam)
> 
> colored and columned?
> 
> I know this is asking a bit much.. but thought I'd ask...
> 
> Cheers
> 
> Craig
> 

You could pipe it through grep and strip out stuff you don't want
displayed.

For example:

tail -f /var/log/maillog |grep -v spamd | grcat conf.log

Will strip any line that has spamd in it from the stream and pass the
rest along to your other script for display.

Other than that you would need to write a script that would parse the
data and reformat it to the way you want it to look.  But I think the
grep -v option might be a very quick way to reduce the amount of stuff
that you don't want displayed.


-- 
Scot L. Harris
webid at cfl.rr.com

I came to MIT to get an education for myself and a diploma for my mother. 





More information about the fedora-list mailing list