Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from_input does not return true #19407

Open
drewmiranda-gl opened this issue May 21, 2024 · 4 comments
Open

from_input does not return true #19407

drewmiranda-gl opened this issue May 21, 2024 · 4 comments

Comments

@drewmiranda-gl
Copy link
Member

I've never used this function before, but since the pipeline editor defaults to the UI, i thought i'd give the pipeline GUI editor a try.

I cannot get any pipeline rules to correctly return true when i use from_input. I'd tried both the input name as well as the input id.

Using get_field("gl2_source_input") == "" does work.

Example:
image

Pipeline rule:

rule "route for testing duplicating messages"
when
  // get_field("gl2_source_input") == "662017e1cfcecf538d9a72f5z" ||
  from_input( 
    id : "662017e1cfcecf538d9a72f5"
  )
then
  set_field(
    field : "aaatest",
    value : "test"
  );
end

Expected Behavior

from_input returns true if the condition is true

Current Behavior

from_input always returns false.

Possible Solution

Steps to Reproduce (for bugs)

  1. Create a pipeline using from_input using the rule editor tester

Context

Your Environment

  • Graylog Version: 6.0.1
  • Browser version: Google Chrome Version 125.0.6422.61 (Official Build) (arm64)

Please let me know if there are any questions.

@drewmiranda-gl
Copy link
Member Author

noting this is similar to #15534 , however that issue is from Graylog 5.0 so likely something unrelated.

@janheise
Copy link
Contributor

@drewmiranda-gl I just took a quick peek out of curiosity - I am not that familiar with that stuff: just want to point out that the ids in your example are different. Maybe a copy/paste error? Also the docs state that it has to be a non-forwarder input and the lookup is going via the input registry - so maybe the input you're choosing to test is just a bad candidate?
Also, the code has not been touched for a long time so #15534 is likely related. IMHO.

@drewmiranda-gl
Copy link
Member Author

Good observation :) i added a z on the end to make sure it didn't match, but other than the z its the same id.

@jrunu
Copy link
Contributor

jrunu commented Sep 24, 2024

I observed this behavior at a customer today as well. The customer was using a rule with just a from_input() that was processing (live) messages. Copied message from the very input were not matching in the rule simulator.

(For context: In our rules we usually match against gl2_source_input the way @drewmiranda-gl suggested)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants