Linux-Bulgaria.ORG
навигация

 

начало

пощенски списък

архив на групата

семинари ...

документи

как да ...

 

 

Предишно писмо Следващо писмо Предишно по тема Следващо по тема По Дата По тема (thread)

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



 

наши приятели

 

линукс за българи
http://linux-bg.org

FSA-BG
http://fsa-bg.org

OpenFest
http://openfest.org

FreeBSD BG
http://bg-freebsd.org

KDE-BG
http://kde.fsa-bg.org/

Gnome-BG
http://gnome.cult.bg/

проект OpenFMI
http://openfmi.net

NetField Forum
http://netField.ludost.net/forum/

 

 

Linux-Bulgaria.ORG

Mailing list messages are © Copyright their authors.