On 09/12/2013 08:12 AM, David Lang wrote:
On Thu, 12 Sep 2013, Rainer Gerhards wrote:

1929.256799878:7f86cdede700: scriptExec: batch of 1 elements, active
0x7f86c8000900, active[0]:1
1929.256805683:7f86cdede700:     IF
1929.256817375:7f86cdede700:       function 'isempty' (id:0, params:1)
1929.256836689:7f86cdede700:         var '$!yummlyLogOrigin!**
supportLevel'
1929.256855896:7f86cdede700: eval expr 0x1b1a570, type 'F[70]'
1929.256862685:7f86cdede700: rainerscript: executing function id 0
1929.256869302:7f86cdede700: rainerscript: invalid function id 0 (name
'isempty')

  it seems that I cannot use ismepty as a function. I don't see isempty
mentioned in rainerscript docs at http://www.rsyslog.com/doc/**
rainerscript.html <http://www.rsyslog.com/doc/rainerscript.html> but I
see isempty documented here http://www.rsyslog.com/doc/**
rsyslog_conf_filter.html<http://www.rsyslog.com/doc/rsyslog_conf_filter.html>but
not sure if that means it can be used in if (and how).


That's the point - "isempty" is a property-based filter thing. Obviously,
you are right and having it as a function would make sense, but currently
there is no such function.

I had not looked at the documentation, I had assumed that the functions
that were available for the property filter had been made into functions
as well

so the property filter version of this would be
:$!yummlyLogOrigin!supportLevel, isempty, '' set $.value="empty";
:$!yummlyLogOrigin!supportLevel, ! isempty, '' set $.value="not empty";

  any ideas whether this is in any way better or worse compared to:

  if $!yummlyLogOrigin!supportLevel == "" then set $.value = "empty"

I assume that after either of those (property filter or if statement) the end result is the same ($.value is set to "empty"), is there any difference in performance?

        erik


David Lang


  also tried:

  if $!yummlyLogOrigin!supportLevel == "" then

  which seems to be working, is that the best way to test if there is no
value for $!yummlyLogOrigin!**supportLevel?


I'd say that's the simplest work-around currently possible (assuming that
an empty string cannot occur validly).

Rainer

  thanks!

        erik

______________________________**_________________
rsyslog mailing list
http://lists.adiscon.net/**mailman/listinfo/rsyslog<http://lists.adiscon.net/mailman/listinfo/rsyslog>

http://www.rsyslog.com/**professional-services/<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.

_______________________________________________
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.

_______________________________________________
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.

_______________________________________________
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