[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gawk] New Features for gawk
From: |
Guenter Goebel |
Subject: |
[bug-gawk] New Features for gawk |
Date: |
Tue, 30 Aug 2011 18:53:15 +0200 |
Hello Guys,
I developed 2 new Features for the gawk and i think it could be
a good Idea to include this Code in the official gawk.
So other People can benefit from this Options, too.
Im an UNIX Systems Engineer from Germany. In the past Years i worked a lot
in the Monitoring Field. I used a Tool named logserver as Logfileadapter,
to check the Entries in the Syslog Files and so on.
But later on i decided me to extend the gawk with two new Options so that gawk
can do the job.
The Options are:
------------------------------------------------------------------------------
-s X --start-record X
Start processing after Record X, the Records from 1 to X are ignored.
Samples: A File with 2 Lines Information Header, with Option "-s 2" the
processing begins with Line 3.
You want process only new syslog Messages, all existend Messages
in the syslog File Should be ignored.
# wc -l /var/log/syslog
1336 /var/log/syslog
# ./gawk -i -s 1336 '/Network is unreachable/ { print $0 }'
/var/log/syslog
-i --ignore-eof
Process appended data as the file grows; ( tail -f like )
Samples: You want to monitor the Oracle Logfile and send EMail by a specific
Log Message.
# wc -l /oracle/admin/DEBUS/bdump/alert_DEBUS.log
12648 /oracle/admin/DEBUS/bdump/alert_DEBUS.log
# ./gawk -i -s 12648 '/ORA-0485/ { MX=sprintf("mail %s",
"address@hidden"); print $0 |& MX; close(MX); }'
/oracle/admin/DEBUS/bdump/alert_DEBUS.log
------------------------------------------------------------------------------
At the Moment i created Code for the 3.18 and the 4.00 gawk Release.
What Do you think? Are you interested to put this Code in the official
Release? And what do you need for that? (Full Source or diffs) ?
Bye, and a nice Day from Germany
Guenter Goebel
- [bug-gawk] New Features for gawk,
Guenter Goebel <=