-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Security Solution][Detections] Fix EQL search request filter when built with exceptions #79753
Conversation
Pinging @elastic/siem (Team:SIEM) |
@@ -110,27 +110,35 @@ export const buildEqlSearchRequest = ( | |||
exceptionFilter = buildExceptionFilter(exceptionQueries, indexPattern, config, true, 1024); | |||
} | |||
const indexString = index.join(); | |||
const requestFilter: unknown[] = [ |
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.
I believe you could use EsRangeFilter
here in place of the unknown
:
const requestFilter: unknown[] = [ | |
const requestFilter: EsRangeFilter[] = [ |
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.
Actually, since you're pushing the bool
object below as well, not sure what the recommended generic Filter type that should be used here...
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! 👍
Pinging @elastic/security-solution (Team: SecuritySolution) |
Summary
The ES query DSL does not support multiple objects within a
filter
object, which is how we were attempting to build the query. Instead,filter
needs to be an array of objects. The EQL search API does not allow the top levelfilter
to be an array so we have to nest thefilter
array within anotherbool
object.Checklist
Delete any items that are not applicable to this PR.
For maintainers