Repository navigation
[SIEM][Detection Engine] Modified gap detection util to accept all dateMath formats - #56055
Merged
Merged
Conversation
…th `from` being any string (invalid, ISO string, now, now-x).
yctercero
marked this pull request as ready for review
January 30, 2020 19:56
yctercero
requested review from
FrankHassanabad
and removed request for
FrankHassanabad
January 30, 2020 20:02
Contributor
|
Pinging @elastic/siem (Team:SIEM) |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
FrankHassanabad
approved these changes
Jan 31, 2020
FrankHassanabad
left a comment
Contributor
There was a problem hiding this comment.
Checked it out, tested it with a query that was 30 seconds, the Gap detection looks to be operating.
Thanks for letting me know you modeled the tests after the others from Kibana core with regards to mocking the times. That was a good thing for me to learn.
LGTM! Merge away and backport
dhurley14
reviewed
Jan 31, 2020
dhurley14
left a comment
Contributor
There was a problem hiding this comment.
Forgot to submit review but tested locally and everything looked great!
yctercero
added a commit
to yctercero/kibana
that referenced
this pull request
Jan 31, 2020
…teMath formats (elastic#56055) * Partial commit - got tests working and `getGapBetweenRuns` working with `from` and `to` being any string (invalid, ISO string, now, now-x). Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
patrykkopycinski
pushed a commit
to patrykkopycinski/kibana
that referenced
this pull request
May 6, 2026
…teMath formats (elastic#56055) * Partial commit - got tests working and `getGapBetweenRuns` working with `from` and `to` being any string (invalid, ISO string, now, now-x). Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modify signals utils gap detection functions to make use of @elastic/datemath. Should account for more edge cases - such as value
toorfrombeing ISO strings, invalid strings, or things other than their defaults.Prior functionality allowed
toto only benowandfromto only benow-x.To test using default rule schedule values, start Kibana -> post a rule -> shut down Kibana for 6+ minutes. You should see an error like the following show up:
Note that it seems there's checks for
toandfromto be valid date strings in ES so if you attempt to create a rule that does not use an ISO string,now, ornow-xyou'll get an error of ES yelling at you. Increate_rules_schema.tswe're just checking for them to be strings.Follow up to #54547
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 support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)Documentation 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