Is there a way to restore time filter selection on Kibana dashboard.
Use case :
We have menu button on our web page from where we open Kibana dashboard by using tokens with the endpoint /internal/security/login for logging.
Once the dashboard opens it has the default the time selection i.e last 1 year.
If a users wants to search data for a particular time window they can change the time filter accordingly. Later, when the use reopens the dashboard by clicking on the menu button the time filter is again set to 1 year.
Thus every time user has to change the time selection.
The last time filter of the user must be restored when the user opens the dashboard.
Is there a way to handle this correctly?
Hi @pranay_jain It sounds like you're looking for a way to set a personalized time-filter and at the moment you have a couple of options:
- It sounds like the Dashboard itself was saved with a time range and you could remove that or save a new one without a time filter to allow users to keep their own selection.
- Users could also save their own copy of the dashboard along with their preferred time range. Note that you'll end up having many copies of the same Dashboard that might get out of synch though.
3 Probably the better alternative is to ask user to save a query that contains their chosen time filter. I don't know what version you're using, so the link is to the docs for the 7.15 version (you can change the version in the docs)
For options 2 and 3, please note that dashboards and saved queries are available to everyone in a Space so each user would have to save their Dashboard/query as as descriptively as possible (e.g. MyName_DashboardABC/MyName_DashboardABC_TimeFilter)
I hope that helps!
Hi @cheiligers, thank you for your response.
What I am trying to achieve is to restore the last time filter when the user reopens the Kibana dashboard on the browser.
I was trying for option #1, where I tried removing the time filters while saving the dashboard.
As a result, I removed the attributes "timeFrom":"now-1y/d" and "timeTo":"now" from the dashboard object (.ndjson file).
Now, when I open the updated dashboard on Kibana, the time filter is always set to last 15 minutes by default. I tried changing it for e.g to last 90 days, close the browser and reopen the dashboard but it resets to 15 minutes.
On the other hand, the time filter selection restores correctly as long as the Kibana browser tab is not closed completely.
Can you please suggest?
Hi @pranay_jain The only way to restore a user's "previously used" time filter at the moment is for each users to save the dashboard after they've set their chosen time filter.
If the dashboard is a shared object, each user will need to save their own copy (use the "Save as" option on the top right) so that they don't override the 'main' dashboard and other users' filters:
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.