-
Notifications
You must be signed in to change notification settings - Fork 919
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
Save time range in searches #3440
Comments
@joshuarrrr I think "sharing" snapshots saves the time frame added in dashboards and discover...but I guess save doesn't. Does the PIT solve for this? |
After review, I believe this is a valid feature request. Current alternatives@51CGO While there's no current way to include the date range in the saved search, there are a couple alternatives that may be useful. 1. Generate "Share" linksAs @ahopp mentioned, one way to "save" a search with the currently selected time range is to use the "Share" option from Discover: Either of the options (Snapshot or Saved object) will work, because the date filters are directly encoded in the URLs: Snapshot permalink example: Saved object permalink example
2. Use saved queriesIn addition to "saved searches", OpenSearch Dashboards also has the concept of "saved queries". You can think of a saved query as a shortcut for easily applying and re-applying any queries, filters and timerange filters, regardless of which OpenSearch Dashboards application you're using (Discover, Visualize, Dashboard). You can save a query with the Save button to the left of the query field. Make sure to enable the "Include time filter" toggle if you want the time filter included. Explanation of current behaviorWhen creating or saving a saved search from discover, both the The date filter, however is not included. I believe this may be due to some quirks in global vs app state, which @abbyhu2000 can provide more info on. @dagneyb It would be useful to get some product insight on the expected behavior here - to me, it makes sense to treat date filters similarly to other filters, but doing so may have some architectural complications. Also CC @vagimeli for ideas on how we could improve documentation around these concepts. |
As @joshuarrrr mentioned, when we create a saved search object, the query and filter will be saved in the saved search object, but not the date filter. This is because the app filter and query are persisted in the app state, and the time filter are persisted in the global state. (Unless we make the filter the global filter by pinning them, then it will also be persisted in the global state). Since time filter are persisted globally, it will be encoded in the '_g' part of the URL, but not the actual saved object. (That is why we can persist the time filter value using Currently, Vis Builder, Visualization, Discover, and Dashboards are onboarded with the global state persistence functionalities. When we create a time filter on one of these pages, and we navigate to another one of these pages, the time filter will be persisted and applied there. For example, if we create a time filter on Discover page, and then we navigate to Dashboard page, the time filter will be automatically applied. The PR has a demo video that showcases the behavior of global persistence for time filter: #2896 (comment) I also think this is a valid feature request, and we can discuss more on whether we should make the time filter not only a global state data but also an app state data so it can be saved within the app state. If we do include the time filter in the discover app state, we should also do the same thing for visualization, vis builder and dashboard plugin to ensure consistent behavior. We should also consider if we need to include the other global data such as the query in the app state as well. |
Is your feature request related to a problem? Please describe.
Saving a search does not save the time range.
Describe the solution you'd like
When saving a search, the Opensearch Dashboards should display a checkbox "Save time range" and the time range box.
Describe alternatives you've considered
Allow query arguments in URL, simplier than the filter format
Additional context
I'm using reporting-cli to generate reports but it's not possible to specify time range for reporting.
The text was updated successfully, but these errors were encountered: