-
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
[Security Solutions] Sets our default date time to be "today" instead of "Last 24 hours" to enable cachability and fixes one date math bug in the URL #93548
Conversation
…me to being today
…nded up in the roundUp
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
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 documentation and the added unit tests; I had no idea that's how those filters were supposed to work 🤦
… of "Last 24 hours" to enable cachability and fixes one date math bug in the URL (elastic#93548) ## Summary Enables caching in our application by setting the default date time of our application to be `from: now/d` and `to: now/d`. When users go to the advanced settings they will see this now: <img width="1243" alt="Screen Shot 2021-03-04 at 11 53 08 AM" src="https://user-images.githubusercontent.com/1151048/110014626-43fb6700-7ce0-11eb-94ee-0c4cc7a8a10f.png"> In their date time bars on page loads they will see today instead of 24 hours: <img width="556" alt="Screen Shot 2021-03-04 at 11 50 18 AM" src="https://user-images.githubusercontent.com/1151048/110015216-dac82380-7ce0-11eb-935d-2d71078c1170.png"> When before they used to have `from: now-24` and `to: now`. This new date time frame plays well with Elastic caches and no longer "busts" them for users on each page request. Now users will send the same date time frame on each query which will cache the views as the default. This also fixes a small bug with the URL's where the "to" was not being rounded up when it was a dynamic date time on first load. For example if you went to the URL, `/app/security/hosts/allHosts` with no additional state information but have a default of `from: now/d` and `to: now/d` it would not round up the date time. Now it rounds it up through the date math utilities which only rounds when it sees that it is a dynamic date math. When requests are being sent, expect to see this where you have `from` rounded down and `to rounded up. This should be a consistent non-sliding date time math for caching to operate: <img width="608" alt="Screen Shot 2021-03-04 at 11 33 11 AM" src="https://user-images.githubusercontent.com/1151048/110015357-01865a00-7ce1-11eb-8580-efacf791b573.png"> If you change the `to` to be another date math such as `now+1d/d` expect to see it also rounded up. This behavior mirrors that of discover: <img width="608" alt="Screen Shot 2021-03-04 at 11 33 11 AM" src="https://user-images.githubusercontent.com/1151048/110015440-17941a80-7ce1-11eb-832d-e826962829ed.png"> You can manually verify this behavior by setting the same now dates in discover as well as security solutions and both should work as is even when you remove the URL state from the right side of a `?` ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
…into actions/terminology-api * 'actions/terminology-api' of github.com:gmmorris/kibana: Make Dashboard Unsaved Changes Space Specific (elastic#92680) Hide Value and Funtional boost for geolocation (elastic#93683) [Fleet] Set all keyword and text fields for `index.query.default_field` index template setting (elastic#91791) can not query the world (elastic#93556) [Security Solutions] Sets our default date time to be "today" instead of "Last 24 hours" to enable cachability and fixes one date math bug in the URL (elastic#93548) [Security Solution][Endpoint][Admin][Policy] Register as AV os restrictions tooltip note (elastic#93306) fix agg config sub agg dsl generation (elastic#93276)
… of "Last 24 hours" to enable cachability and fixes one date math bug in the URL (#93548) (#93692) ## Summary Enables caching in our application by setting the default date time of our application to be `from: now/d` and `to: now/d`. When users go to the advanced settings they will see this now: <img width="1243" alt="Screen Shot 2021-03-04 at 11 53 08 AM" src="https://user-images.githubusercontent.com/1151048/110014626-43fb6700-7ce0-11eb-94ee-0c4cc7a8a10f.png"> In their date time bars on page loads they will see today instead of 24 hours: <img width="556" alt="Screen Shot 2021-03-04 at 11 50 18 AM" src="https://user-images.githubusercontent.com/1151048/110015216-dac82380-7ce0-11eb-935d-2d71078c1170.png"> When before they used to have `from: now-24` and `to: now`. This new date time frame plays well with Elastic caches and no longer "busts" them for users on each page request. Now users will send the same date time frame on each query which will cache the views as the default. This also fixes a small bug with the URL's where the "to" was not being rounded up when it was a dynamic date time on first load. For example if you went to the URL, `/app/security/hosts/allHosts` with no additional state information but have a default of `from: now/d` and `to: now/d` it would not round up the date time. Now it rounds it up through the date math utilities which only rounds when it sees that it is a dynamic date math. When requests are being sent, expect to see this where you have `from` rounded down and `to rounded up. This should be a consistent non-sliding date time math for caching to operate: <img width="608" alt="Screen Shot 2021-03-04 at 11 33 11 AM" src="https://user-images.githubusercontent.com/1151048/110015357-01865a00-7ce1-11eb-8580-efacf791b573.png"> If you change the `to` to be another date math such as `now+1d/d` expect to see it also rounded up. This behavior mirrors that of discover: <img width="608" alt="Screen Shot 2021-03-04 at 11 33 11 AM" src="https://user-images.githubusercontent.com/1151048/110015440-17941a80-7ce1-11eb-832d-e826962829ed.png"> You can manually verify this behavior by setting the same now dates in discover as well as security solutions and both should work as is even when you remove the URL state from the right side of a `?` ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios Co-authored-by: Frank Hassanabad <[email protected]>
I ended up needing to revert this change as it began failing in both branches: https://kibana-ci.elastic.co/job/elastic+kibana+master/12351/execution/node/179/log/ |
## Summary Unreverts: #93548 By fixing tests that are relying on date times to be less strict. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
## Summary Unreverts: elastic#93548 By fixing tests that are relying on date times to be less strict. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
## Summary Unreverts: #93548 By fixing tests that are relying on date times to be less strict. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios Co-authored-by: Frank Hassanabad <[email protected]>
Summary
Enables caching in our application by setting the default date time of our application to be
from: now/d
andto: now/d
. When users go to the advanced settings they will see this now:In their date time bars on page loads they will see today instead of 24 hours:
When before they used to have
from: now-24
andto: now
. This new date time frame plays well with Elastic caches and no longer "busts" them for users on each page request. Now users will send the same date time frame on each query which will cache the views as the default.This also fixes a small bug with the URL's where the "to" was not being rounded up when it was a dynamic date time on first load. For example if you went to the URL,
/app/security/hosts/allHosts
with no additional state information but have a default offrom: now/d
andto: now/d
it would not round up the date time. Now it rounds it up through the date math utilities which only rounds when it sees that it is a dynamic date math.When requests are being sent, expect to see this where you have
from
rounded down and `to rounded up. This should be a consistent non-sliding date time math for caching to operate:If you change the
to
to be another date math such asnow+1d/d
expect to see it also rounded up. This behavior mirrors that of discover:You can manually verify this behavior by setting the same now dates in discover as well as security solutions and both should work as is even when you remove the URL state from the right side of a
?
Checklist