-
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
[SIEM] bugfix data fetch error in Uncommon Processes table #38706
[SIEM] bugfix data fetch error in Uncommon Processes table #38706
Conversation
Pinging @elastic/secops |
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, do we have this somewhere else?
@@ -75,7 +75,7 @@ export const getHits = ( | |||
export const getHosts = (buckets: ReadonlyArray<{ key: string; host: HostHits }>) => | |||
buckets.map(bucket => ({ | |||
id: [bucket.key], | |||
name: bucket.host.hits.hits[0]._source.host.name, | |||
name: get('host.name', bucket.host.hits.hits[0]._source), |
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.
Nice solution! But I would be more confident if put it like this, not sure if buckets always return with elements or elements in expected format.
get(`host.hits.hits.0._source.host.name`, bucket),
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 just pushes the problem into the get. i can do 2 gets?
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 updated it, lmk what you think
@XavierM I looked all over but did not see it anywhere |
💚 Build Succeeded |
💔 Build Failed |
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.
Thanks for the fast fix! Appreciate the tests added for this as well.
💚 Build Succeeded |
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.
Looks good! 👍 👍 👍
…8706) [SIEM] bugfix data fetch error in Uncommon Processes table
Summary
This PR fixes an issue that caused a data fetch error in the Uncommon Processes table as outlined in this issue: https://github.com/elastic/ingest-dev/issues/526
The issue was caused by some
_source
data being in the form of{ 'host.name': 'blah' }
and we were reading the data using dot notation, which only works for this form{ host: { name: 'blah' } }
. By using lodash'sget
, graphql will now be able to read the host data object whether it'shost {
orhost.*
.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.This was checked for cross-browser compatibility, including a check against IE11Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n supportDocumentation was added for features that require explanation or tutorialsThis was checked for keyboard-only and screenreader accessibilityFor maintainers
This was checked for breaking API changes and was labeled appropriatelyThis includes a feature addition or change that requires a release note and was labeled appropriately