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
Execute a single rule in isolation #14892
Conversation
60b6ee3
to
d290bb6
Compare
...og2-server/src/main/java/org/graylog/plugins/pipelineprocessor/rest/SimulateRuleRequest.java
Outdated
Show resolved
Hide resolved
...rver/src/main/java/org/graylog/plugins/pipelineprocessor/processors/PipelineInterpreter.java
Outdated
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/rest/RuleResource.java
Outdated
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/rest/RuleResource.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backend LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works and looks good! 👍
@@ -46,7 +46,9 @@ class MessageFields extends React.Component { | |||
|
|||
render() { | |||
const { message } = this.props; | |||
const formattedFields = message.formatted_fields; | |||
// eslint-disable-next-line no-unused-vars | |||
const { _id, ...formatted_fields } = message.fields; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the _id
? I think we can use _
and eslint might not complain, but not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We basically need formatted_fields
only, so we needed to add _id
to get the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Resolves #14891
Leverage existing code in PipelineInterpreter to simulate a single rule in isolation, i.e.
We just take in a message string and run the rule on it.
Introduces a new API, which takes in a rule and an input message. It returns the processed message.