Re: lug-bg: tail -f | grep ... | cut ... | awk ...
- Subject: Re: lug-bg: tail -f | grep ... | cut ... | awk ...
- From: borj@xxxxxxxxx (Boris Jordanov)
- Date: Thu, 31 Jan 2002 15:22:19 +0200
#!/usr/pkg/bin/perl -w
my ($col1,$col2,$col3,$col4,$col5,$rest);
NEWLINE: while (<>) {
($col1,$col2,$col3,$rest) =
/^(.+?\s.+?\s.+?\s)(.+?\s)(.+?:\s)(.*)/;
print $col3, "\n"; #Tuk si slagash izikvane na ipchains/iptables
ili kakvoto trjabva
}
Toja code e pisan po princip za "live" analiz na syslog, zatova i regular
expression-a e takuv, samo si go promeni da ti pasva na tebe i celia nomer
izglezda taka:
tail -f /var/log/messages|ime_na_gornoto_programche
Take care
Boris Jordanov (borj) <borj@xxxxxxxxx>
ICQ 10751645
PGP-key-fingerprint:------------------------------
CB23 8B52 5FBC F36A 1B61 F1ED 2831 E52D AAFF 7B08
--------------------------------------------------
Public-key:---------------------------------------
http://borj.freeshell.org/borj.asc
--------------------------------------------------
To err is human...
to really foul up requires the root password.
<HR>
<UL>
<LI>application/pgp-signature \\\\\\\\\ \\\\: stored
</UL>
===========================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers)
http://www.linux-bulgaria.org/ Hosted by Internet Group Ltd. - Stara Zagora
|