$level()
DESCRIPTION
returns the current script's severity level
(EMERG, ALERT, CRIT, ERR, WARNING, NOTICE, INFO, DEBUG)
SYNOPSIS
$level()
ARGUMENTS
none
EXAMPLES
begin
if $level() !~~ "emerg|alert"
=checkpoint(=lalim)
fi
rule
if $level() =~~ "emerg|alert" // alert == urgent
&& $inlin =~~ "=redflags"
leave
elsif $level() =~~ "critical"
&& $inlin =~~ "=yellowflags"
leave
elsif $alarm() eq "ScanDmesg"
&& $inlin =~~ "=redflags|=yellowflags"
leave
else
next
fi
[proceed with analyzing the current logfile line ...]
begin
...
// set the reporting period
#if missioncritical
if $level() =~~ "emerg"
set #period = 60 // every 60 minutes
elsif $level() =~~ "alert"
set #period = 120 // every 120 minutes
else
set #period = 240 // every 240 minutes
fi
#else
if $level() =~~ "emerg"
set #period = 120 // every 120 minutes
elsif $level() =~~ "alert"
set #period = 240 // every 240 minutes
else
set #period = 24*60 // once daily
fi
#endif
...
...
rule
=periodically(=psheader output mail $inlin, , #period)
SEE ALSO
#level()
$alert()
$alarm()
$status()
$task()
$lpcmd()
$mailcmd()
String Functions
Numerical Functions