Skip to content

Instantly share code, notes, and snippets.

@arkag
Last active January 3, 2020 17:39
Show Gist options
  • Save arkag/f087507dd02544537f417571a1987d6c to your computer and use it in GitHub Desktop.
Save arkag/f087507dd02544537f417571a1987d6c to your computer and use it in GitHub Desktop.
set $!alarmmsg1 = "hello";
set $!alarmfile = "alarm";
if ($programname == "hello" and $msg contains $!alarmmsg1) then { set $!appmsg = "alarm"; }
else { set $!appmsg = "not-an-alarm"; }
template(name="%$!alarmfile%" type="string" string="{{ hub_log_mount }}/%$!env%/%$!alarmfile%.log")
if ( $!appmsg == "alarm" ) then
{
action(name="alarm" type="omfile" dynaFile="%$!alarmfile%" fileCreateMode="0644" dirCreateMode="0755" dynaFileCacheSize="100")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment