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

[Security Solution][Detections] Look-back time logic fix #81383

Merged
merged 3 commits into from
Oct 22, 2020

Conversation

dplumlee
Copy link
Contributor

@dplumlee dplumlee commented Oct 21, 2020

Summary

Addresses #74767

Changes logic to not clobber specific look-back times. Before we would change values over 1 minute to the lowest minute (e.g. 90 sec -> 1 min), and values over 1 hour to the lowest hour (e.g. 137 min -> 2 hr). This fixes our logic so we display the look-back time in whatever units the user selected unless they enter a time factorable number, in which case we factor that down (e.g. 120 min -> 2 hr, 300 sec -> 5 min)

Screenshots

Screen Shot 2020-10-21 at 12 12 38 PM

Screen Shot 2020-10-21 at 12 12 49 PM

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@dplumlee dplumlee self-assigned this Oct 21, 2020
return `${Math.floor(fromDuration.asSeconds())}s`;
} else if (fromDuration.asMinutes() < 60) {
return `${Math.floor(fromDuration.asMinutes())}m`;
// Basing calculations off floored seconds count as moment durations weren't precise
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 stopped using the moment duration in these calculations because they weren't consistent/precise and made the tests flaky.

@dplumlee dplumlee marked this pull request as ready for review October 21, 2020 19:32
@dplumlee dplumlee requested review from a team as code owners October 21, 2020 19:32
@elasticmachine
Copy link
Contributor

Pinging @elastic/siem (Team:SIEM)

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

async chunks size

id before after diff
securitySolution 8.1MB 8.1MB +13.0B

History

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

@dplumlee dplumlee merged commit bd94486 into elastic:master Oct 22, 2020
@dplumlee dplumlee deleted the lookback-time-ui branch October 22, 2020 01:23
gmmorris added a commit to gmmorris/kibana that referenced this pull request Oct 22, 2020
* master: (63 commits)
  [KP] Fix Headers timeout issue (elastic#81140)
  [ML] Functional tests - stabilize typing with checks service method (elastic#81338)
  tabify - support docs (elastic#80351)
  [Security Solution][Detections] Look-back time logic fix (elastic#81383)
  [Workplace Search] Add top-level tests for Groups (elastic#81215)
  [Fleet] Fix agent action observable for long polling (elastic#81376)
  [Maps] fix feature tooltip remains open when zoom level change hides layer (elastic#81373)
  skip flaky suite (elastic#78689)
  chore(NA): add spec-to-console and plugin-helpers as devOnly dependencies (elastic#81357)
  Ensure some data is returned (elastic#81375)
  Change dumb-init to tini (elastic#81126)
  [Reporting/Tech Debt] Convert PdfMaker class to TypeScript (elastic#81242)
  Use Storybook Controls instead of Knobs (elastic#80705)
  [junit] make sure that report paths are unique (elastic#81255)
  bump elastic/elasticsearch-js version to 7.10.0-rc1 (elastic#81288)
  run ssl tests on CI (elastic#81320)
  Fix alert defaults (elastic#81207)
  [ML] DF Analytics wizard: ensure user can set mml manually or select to use given estimate (elastic#81078)
  Add UI notifier to indicate secret fields and to remember / reenter values (elastic#80657)
  [Monitoring] Use async/await (elastic#81200)
  ...
@MindyRS MindyRS added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Detection Rules Security Solution rules and Detection Engine release_note:fix Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:SIEM v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants