Hi all,
I have set a rule as follow, but I can't get %time1 when write SEC_fifo
type=PairWithWindow
ptype=RegExp
pattern=(\S+) ONS-15454 Carrier Loss On The LAN in (\S+)
\(majorServiceAffecting\),ifIndex=(.+)
desc=Carrier Loss On The LAN in %2,ifIndex=%3
action=lcall %time1 -> ( sub { my(@time1) = localtime(); \
my($timestamp) = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", \
$time1[5]+1900, $time1[4]+1, $time1[3], $time1[2], $time1[1], $time1[0]); \
return $timestamp; } )
ptype2=RegExp
pattern2=(\S+) NONS-15454 Transport Layer Failure in (\S+)
\(majorServiceAffecting\),ifIndex=(.+)
desc2= NONS-15454 Transport Layer Failure in $2,ifIndex=$3
action2=lcall %time -> ( sub { my(@time) = localtime(); \
my($timestamp) = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", \
$time[5]+1900, $time[4]+1, $time[3], $time[2], $time[1], $time[0]); \
return $timestamp; } );write SEC_fifo
%time1,%time,ONS-15454,NONS-15454,%2,$2,carrierLossOnTheLAN,Critical,%1,tran
sportLayerFailure,Major,$1,ONS-15454 %2(%3)<> NONS-15454 $2($3),ONS-15454
Carrier Loss On The LAN %2 ifIndex=%3 and %s;shellcmd
/home/andrew/code/sendmail.sh "ONS-15454 Carrier Loss On The LAN %2
ifIndex=%3" "%s" "%time"
window=10
Can anyone tell me what is wrong in my rule ?
Thanks,
Andrew
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users