$IncludeConfig diag-common.conf

template(name="outfmt" type="list") {
	property(name="$!usr!msgnum")
	constant(value="\n")
}

set $!var1 = "43";
set $!var2 = "42";
if $!var1 > $!var2 then {
        if $!var2 > $!var1 then {
                # Failure
                stop
        } else {
                unset $!var1;
                unset $!var2;
        }
} else {
        # Failure
        stop
}
set $.var1 = "43";
set $.var2 = "42";
if $.var1 > $.var2 then {
        if $.var2 > $.var1 then {
                # Failure
                stop
        } else {
                unset $.var1;
                unset $.var2;
        }
} else {
        # Failure
        stop
}
set $/var1 = "43";
set $/var2 = "42";
if $/var1 > $/var2 then {
        if $/var2 > $/var1 then {
                # Failure
                stop
        } else {
                unset $/var1;
                unset $/var2;
        }
} else {
        # Failure
        stop
}

if $msg contains 'msgnum' then {
	set $!usr!msgnum = field($msg, 58, 2);
	action(type="omfile" file="./rsyslog.out.log" template="outfmt")
}
