Cherry-pick #20994 to 7.x: [Elastic Agent] Add support for EQL based conditions#21039
Merged
blakerouse merged 3 commits intoelastic:7.xfrom Sep 9, 2020
Merged
Cherry-pick #20994 to 7.x: [Elastic Agent] Add support for EQL based conditions#21039blakerouse merged 3 commits intoelastic:7.xfrom
blakerouse merged 3 commits intoelastic:7.xfrom
Conversation
* Refactor Boolexp to Eql. * Connect new Eql to specs and input emitter. * Fix compare with null. * Fix notice and go.mod. (cherry picked from commit af91b5e)
Contributor
|
Pinging @elastic/ingest-management (Team:Ingest Management) |
ph
approved these changes
Sep 9, 2020
Contributor
ph
left a comment
There was a problem hiding this comment.
backport lgmt, waiting for green.
Looking at this PR, we should have a changelog entry.
Contributor
Author
|
@ph Added changelog. |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #20994 to 7.x branch. Original message:
What does this PR do?
This adds the ability for a condition to be defined any where in the inputs configuration to make that dictionary conditional on the resulting EQL evaluation. If the evaluation is false the dictionary is removed from the parent type and if its true the dictionary remains.
This implements EQL with the same variable syntax used in input variable substitution
${ .. }. The following is implemented for EQL.+ - * / %.< <= >= > == !=truefalseandandorarrayContainshasKey(not in EQL)lengthadd,subtract,multiply,divide,modulo.concat,endsWith,indexOf,match,number,startsWith,string,stringContains.Why is it important?
To support condition enablement on inputs or even any part of the input configuration. The same conditions can be applied to processors or streams or anything inside of the inputs configuration.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration filesCHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.How to test this PR locally
Add a
conditionto your inputs and see that they are not rendered when the condition fails.Condition on input
Condition on stream
Condition on processor
Related issues