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] Fixes Host Details Events Table to only show events for specified Host #57388

Merged
merged 2 commits into from
Feb 12, 2020

Conversation

spong
Copy link
Member

@spong spong commented Feb 11, 2020

Summary

Fixes an issue where the Events Table on the Host Details page would show all events instead of those for the specific host. Also adds tests to make sure this doesn't happen again 🙂

Note: This will not interfere with any user-added queries/filters as those are added separately.

Before / After (See Event count at bottom of image)

Screen_Shot_2020-02-11_at_15_35_12 Screen_Shot_2020-02-11_at_15_46_23

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@spong spong added bug Fixes for quality problems that affect the customer experience release_note:fix Team:SIEM v8.0.0 v7.7.0 v7.6.1 labels Feb 11, 2020
@spong spong self-assigned this Feb 11, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/siem (Team:SIEM)

},
]);
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Thanks for the test!

Copy link
Contributor

Choose a reason for hiding this comment

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

Optionally you can do this trick:

    it('correctly constructs pageFilters for the given hostName', () => {
      const expected: esFilters.Filter[] = [
        {
          meta: {
            alias: null,
            negate: false,
            disabled: false,
            type: 'phrase',
            key: 'host.name',
            value: 'host-1',
            params: {
              query: 'host-1',
            },
          },
          query: {
            match: {
              'host.name': {
                query: 'host-1',
                type: 'phrase',
              },
            },
          },
        },
      ];
      expect(getHostDetailsPageFilters('host-1')).toEqual(expected);

And if that type ever changes your type script will blow up before the test does and ensure that your expected type here always matches your filter type.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ooh nice little improvement there -- thanks @FrankHassanabad! I've made the change and will take this little tidbit with me going forward 🙂

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.

LGTM, checked it out, tested it and left some feedback.

Overall works as advertised and is a good fix. Would highly recommend ++ AAA rating

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@spong spong merged commit 93138a3 into elastic:master Feb 12, 2020
@spong spong deleted the fix-host-details-events-table branch February 12, 2020 03:11
spong added a commit to spong/kibana that referenced this pull request Feb 12, 2020
…ied Host (elastic#57388)

## Summary

Fixes an issue where the `Events Table` on the `Host Details` page would show all events instead of those for the specific host. Also adds tests to make sure this doesn't happen again 🙂 

Note: This will not interfere with any user-added queries/filters as those are added separately. 

##### Before / After (See Event count at bottom of image)
<img width="300" alt="Screen_Shot_2020-02-11_at_15_35_12" src="https://user-images.githubusercontent.com/2946766/74286988-2f6bbb80-4ce6-11ea-9ca2-35d4ae9ff3f2.png"> <img width="300" alt="Screen_Shot_2020-02-11_at_15_46_23" src="https://user-images.githubusercontent.com/2946766/74287150-840f3680-4ce6-11ea-9267-365753a52fc2.png">



### Checklist

Delete any items that are not applicable to this PR.

- [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~
- [ ] ~[Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~
- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
- [ ] ~This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~
- [ ] ~This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)~
- [ ] ~This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~

### For maintainers

- [ ] ~This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
spong added a commit to spong/kibana that referenced this pull request Feb 12, 2020
…ied Host (elastic#57388)

## Summary

Fixes an issue where the `Events Table` on the `Host Details` page would show all events instead of those for the specific host. Also adds tests to make sure this doesn't happen again 🙂 

Note: This will not interfere with any user-added queries/filters as those are added separately. 

##### Before / After (See Event count at bottom of image)
<img width="300" alt="Screen_Shot_2020-02-11_at_15_35_12" src="https://user-images.githubusercontent.com/2946766/74286988-2f6bbb80-4ce6-11ea-9ca2-35d4ae9ff3f2.png"> <img width="300" alt="Screen_Shot_2020-02-11_at_15_46_23" src="https://user-images.githubusercontent.com/2946766/74287150-840f3680-4ce6-11ea-9267-365753a52fc2.png">



### Checklist

Delete any items that are not applicable to this PR.

- [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~
- [ ] ~[Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~
- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
- [ ] ~This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~
- [ ] ~This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)~
- [ ] ~This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~

### For maintainers

- [ ] ~This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
spong added a commit that referenced this pull request Feb 12, 2020
…ied Host (#57388) (#57408)

## Summary

Fixes an issue where the `Events Table` on the `Host Details` page would show all events instead of those for the specific host. Also adds tests to make sure this doesn't happen again 🙂 

Note: This will not interfere with any user-added queries/filters as those are added separately. 

##### Before / After (See Event count at bottom of image)
<img width="300" alt="Screen_Shot_2020-02-11_at_15_35_12" src="https://user-images.githubusercontent.com/2946766/74286988-2f6bbb80-4ce6-11ea-9ca2-35d4ae9ff3f2.png"> <img width="300" alt="Screen_Shot_2020-02-11_at_15_46_23" src="https://user-images.githubusercontent.com/2946766/74287150-840f3680-4ce6-11ea-9267-365753a52fc2.png">



### Checklist

Delete any items that are not applicable to this PR.

- [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~
- [ ] ~[Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~
- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
- [ ] ~This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~
- [ ] ~This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)~
- [ ] ~This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~

### For maintainers

- [ ] ~This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
spong added a commit that referenced this pull request Feb 12, 2020
…ied Host (#57388) (#57407)

## Summary

Fixes an issue where the `Events Table` on the `Host Details` page would show all events instead of those for the specific host. Also adds tests to make sure this doesn't happen again 🙂 

Note: This will not interfere with any user-added queries/filters as those are added separately. 

##### Before / After (See Event count at bottom of image)
<img width="300" alt="Screen_Shot_2020-02-11_at_15_35_12" src="https://user-images.githubusercontent.com/2946766/74286988-2f6bbb80-4ce6-11ea-9ca2-35d4ae9ff3f2.png"> <img width="300" alt="Screen_Shot_2020-02-11_at_15_46_23" src="https://user-images.githubusercontent.com/2946766/74287150-840f3680-4ce6-11ea-9267-365753a52fc2.png">



### Checklist

Delete any items that are not applicable to this PR.

- [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~
- [ ] ~[Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~
- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
- [ ] ~This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~
- [ ] ~This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)~
- [ ] ~This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~

### For maintainers

- [ ] ~This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience release_note:fix Team:SIEM v7.6.1 v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants