graylog2-server icon indicating copy to clipboard operation
graylog2-server copied to clipboard

newly created field by set_field not visible to has_field test in same pipeline stage

Open callworkslab opened this issue 8 years ago • 5 comments

newly created field by set_field not visible to has_field test in same pipeline stage

Expected Behavior

newly create field by set_field should be immediately visible for has_field test in same stage

Current Behavior

newly created field by set_field not visible to has_field test in same pipeline stage

Steps to Reproduce (for bugs)

create the following pipeline, and input message will got field following_stage_visible and value being true, but no same_stage_visible field, which means the newly created new_field not visible to has_field test at same stage, only available to following stages.

stage 0 match either
    rule "always true";
    rule "new_field visible to has_field at same stage";
stage 1 match all
    rule "new_field visible to has_field at following stages";
end

rule "always true"
when
     true
then
	set_field("new_field","something");
end

rule "new_field visible to has_field at same stage"
when
	has_field("new_field")
then
	set_field("same_stage_visible", true);
end

rule "new_field visible to has_field at following stages"
when
	has_field("new_field")
then
	set_field("following_stage_visible", true);
end

Your Environment

  • Graylog Version: 2.4.3-1
  • Elasticsearch Version: 5.6.8-1
  • MongoDB Version: mongodb-enterprise-3.6.3-1
  • Operating System: CentOS 7.4
  • Browser version: firefox-52.7.2-1

callworkslab avatar Mar 29 '18 08:03 callworkslab

more tests show that the new created field is visible to set_field function at same stage, but also not visible to is_null/is_not_null test function also.

callworkslab avatar Mar 31 '18 06:03 callworkslab

if using the newly created field in following rules in the same stage, system will write a WARN message into server.log like following:

2018-04-02T00:15:51.850+08:00 WARN [EqualityExpression] left expression evaluated to null, returning false: $message.field_name

when message rate is high, soon the hard disk will full with logs.

callworkslab avatar Apr 01 '18 17:04 callworkslab

Refs https://community.graylog.org/t/new-fields-visiblity-to-field-test-functions-in-same-stage/4791

joschi avatar Apr 04 '18 09:04 joschi

@kroepke: Can you comment if this is an issue or by design?

dennisoelkers avatar Apr 16 '18 09:04 dennisoelkers

works if field is created before routing to stream and won't after.

satyavadali avatar Oct 28 '19 01:10 satyavadali