Skip to content
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

Merged

Conversation

stephmilovic
Copy link
Contributor

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's get, graphql will now be able to read the host data object whether it's host { or host.*.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@elasticmachine
Copy link
Contributor

Pinging @elastic/secops

@stephmilovic stephmilovic changed the title fix data fetch error by using lodash get [SIEM] bugfix data fetch error in Uncommon Processes table Jun 11, 2019
Copy link
Contributor

@XavierM XavierM left a 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),
Copy link
Contributor

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),

Copy link
Contributor Author

@stephmilovic stephmilovic Jun 11, 2019

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?

Copy link
Contributor Author

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

@stephmilovic
Copy link
Contributor Author

@XavierM I looked all over but did not see it anywhere

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@FrankHassanabad FrankHassanabad left a 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.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@angorayc angorayc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍 👍 👍

@stephmilovic stephmilovic merged commit 42480a3 into elastic:master Jun 12, 2019
@stephmilovic stephmilovic deleted the uncommon-processes-data-failure branch June 12, 2019 16:25
stephmilovic added a commit to stephmilovic/kibana that referenced this pull request Jun 12, 2019
…8706)

[SIEM] bugfix data fetch error in Uncommon Processes table
stephmilovic added a commit that referenced this pull request Jun 12, 2019
…38803)

[SIEM] bugfix data fetch error in Uncommon Processes table
@stephmilovic stephmilovic added the release_note:skip Skip the PR/issue when compiling release notes label Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
loe:small Small Level of Effort release_note:skip Skip the PR/issue when compiling release notes Team:SIEM v7.3.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants