$IncludeConfig diag-common.conf

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

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

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