Nand and xor operators not working



I am using logstash 1.5.4 version on Ubuntu 14.04. I am unable to make use of nand, xor operator in conditionals.

The error resulted and the configuration used for xor operator example is given below: (similar error appears for nand operator as well)


SyntaxError: (eval):22: syntax error, unexpected tIDENTIFIER
if (((x = event["[type]"]; x.respond_to?(:include?) && x.include?(("cwout")))) xor (event["[type]"] == ("cricket"))) # if "cwout" in [type] xor [type] == "cricket"
eval at org/jruby/
initialize at /logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/pipeline.rb:31
execute at /logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/agent.rb:114
run at /logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/runner.rb:90
call at org/jruby/
run at /logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/runner.rb:95
call at org/jruby/
initialize at /logstash-1.5.4/vendor/bundle/jruby/1.9/gems/stud-0.0.22/lib/stud/task.rb:24

Configuration used is:

type => "stdin-input"
if "cwout" in [type] xor [type] == "cricket"
stdout {}

Can anyone tell me the solution for this ?

(Magnus B├Ąck) #2

AFAICT this is a bug in Logstash. I've reported it as issue #4012. You can obviously work around the bug by rewriting the expression.

(system) #3