On Mon, 21 Oct 2013, Rainer Gerhards wrote:

On Mon, Oct 21, 2013 at 8:52 AM, Rainer Gerhards
<[email protected]>wrote:

On Sun, Oct 20, 2013 at 6:03 PM, Pavel Levshin <[email protected]>wrote:


I am unable to reproduce this behaviour with global variables. This is
what I've tried among others:

    if $/zz % 3 == 0 or $/zz % 3 == 1 then {
        set $/zz = $/zz + 1;
        action(...)
    } else {
        set $/zz = 0;
        action(...)
    }

Could you please explain how is it supposed to work?


It's supposed to work just as you describe it. But indeed, it doesn't do
so, I can reproduce the problem. Looks like a regression. Thanks for
reporting, will now look into it.


OK, looks like I stumbled into my own trap. In script, you access
properties via $<propname>. Global variables have the name $/zz (with zz
being the real name). So to access them, you need to access $$/zz.

I think I got confused about this some time ago, and the doc is also not
correct or at least inconsistent. I now need to work my way through that
mess. Just thought I give you some explanation.

Ouch, this is going to get ugly since $$var actually ends up giving you a reference to $var not it's value, I believe from prior discussions that the normal variables are $property of $!var!var, so to have these be $$/var is inconsistant. Since this is a new feature can they be changed to just be $/var?

also, check local variables, are they $.var or $$.var?

David Lang
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to