-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Security Solution][Detections] - Fix remaining render and validation bug with query preview + tests #80110
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
Conversation
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.
Removed these changes as I'm no longer using this component.
x-pack/plugins/security_solution/public/common/containers/matrix_histogram/index.ts
Outdated
Show resolved
Hide resolved
...plugins/security_solution/public/detections/components/rules/eql_query_bar/eql_query_bar.tsx
Outdated
Show resolved
Hide resolved
rylnd
left a comment
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.
A few quick fixes should get the validity logic a little tighter, here, especially around EQL rules. Otherwise, this looks great!
...plugins/security_solution/public/detections/components/rules/eql_query_bar/eql_query_bar.tsx
Outdated
Show resolved
Hide resolved
...plugins/security_solution/public/detections/components/rules/eql_query_bar/eql_query_bar.tsx
Outdated
Show resolved
Hide resolved
...plugins/security_solution/public/detections/components/rules/eql_query_bar/eql_query_bar.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx
Outdated
Show resolved
Hide resolved
59d57fd to
e914beb
Compare
💚 Build SucceededMetrics [docs]@kbn/optimizer bundle module count
async chunks size
page load bundle size
History
To update your PR or re-run it, just comment with: |
|
@MikePaquette @marrasherrier getting feedback on the sequence histogram, that it's not very intuitive and not sure that it's of any added value. @madirey suggested maybe embedding resolver as it is able to visually represent event sequences, or maybe we could just show total hits when we detect that the query is a sequence? |
|
@yctercero I was able to somewhat reliably reproduce an issue where hitting Preview did not update the UI:
Often, the preview request would be issued, but no UI would update/no histogram would be displayed. |
rylnd
left a comment
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.
This looks great! I'm really liking the rxjs stuff, I can't wait to play more with observables 🤗 .
I had one (product) question about the sequences preview histogram, and another issue with the preview button occasionally not working.
| abortSignal: abortCtrl.current.signal, | ||
| } | ||
| ) | ||
| .pipe(takeUntil(unsubscribeStream.current)) |
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 really like this pattern! The semantics of emitting to this to unsubscribe isn't exactly intuitive (to me), but it seems like a common solution to this scoping/unsubscribing issue. There are also some eslint hooks for rxjs (e.g. no-unsafe-takeuntil) that we might want to enable
| if (!didCancel.current) { | ||
| setLoading(false); | ||
| if (hasEqlSequenceQuery(query)) { | ||
| setResponse(getSequenceAggs(res, refetch.current)); |
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.
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.
Taking a step back, the existing histogram is somewhat surprising in its behavior. There appear to be only two buckets in this graph:
Or perhaps each unique timestamp string is its own bucket? I'm not sure what the default behavior for their ordinal scale is, but the latter seems likely.
To me the graph is conveying three data points: the number of results, the number of sequences, and their distribution over time. However, distribution over time is ambiguous and potentially lossy/misleading; we may want to reconsider how we present this data for sequences.
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.
Could we just preview this in an embedded Resolver?
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'm not sure what you have against rainbow graphs @rylnd 😜 I have a draft where I'm trying to see if displaying it in more of a Gantt type form helps. Will definitely follow up with @MikePaquette and @marrasherrier on this.
@madirey I wonder how heavy that would be, or is it already easily embeddable?
madirey
left a comment
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.
Tested manually with several different EQL queries. Aside from the pending questions about the histogram, this LGTM. Thank you!
|
Merging, with the following issues being addressed as follow up:
|
… bug with query preview + tests (elastic#80110) ## Summary This PR is meant to address the remaining rule query preview bugs. It addresses the following: - gives same loading experience for all rule query types (previously there were two different loading states) - makes sure noise warnings are showing for all query types and disappear on timeframe or query change - updates when to/from are set so it is set on preview click
… bug with query preview + tests (elastic#80110) ## Summary This PR is meant to address the remaining rule query preview bugs. It addresses the following: - gives same loading experience for all rule query types (previously there were two different loading states) - makes sure noise warnings are showing for all query types and disappear on timeframe or query change - updates when to/from are set so it is set on preview click
… bug with query preview + tests (#80110) (#80424) ## Summary This PR is meant to address the remaining rule query preview bugs. It addresses the following: - gives same loading experience for all rule query types (previously there were two different loading states) - makes sure noise warnings are showing for all query types and disappear on timeframe or query change - updates when to/from are set so it is set on preview click
… bug with query preview + tests (#80110) (#80425) ## Summary This PR is meant to address the remaining rule query preview bugs. It addresses the following: - gives same loading experience for all rule query types (previously there were two different loading states) - makes sure noise warnings are showing for all query types and disappear on timeframe or query change - updates when to/from are set so it is set on preview click



Summary
This PR is meant to address the remaining rule query preview bugs. It addresses the following:
Custom query
Threshold query
Eql query
Eql sequence query
Checklist