This is a feature request. It would be great if dashboards were able to be paramaterized, so that we could pass search query terms via the URL to the searches run by the widgets on the dashboard.
Currently there is no way to pass parameters to widgets / dashboards that I can see.
For example if all searches had customer_id:{{PARAM_CUSTOMER_ID}} in their saved terms and we passed CUSTOMER_ID=12345 in the url as GET parameter, the {{PARAM_CUSTOMER_ID}} would be substituted with 12345
My use case is to integrate a dashboard with a customer-specific view into other apps via IFrame without having to make a dashboard for every customer.
that would be great!
+1
Adding to this, the possibility to put a search bar onto the dashboard or even predefined field filters (like a dropdown with "select value for field severity":["4","3","2","1"], either pre-populated or dynamically generated by the last values) that temporary adds their respective values to all queries on this particular dashboard would improve the day-to-day usage of dashboards a lot.
Alternative idea:
Adding a search box to the dashboard. The query there is than prefixed to all widgets on this dashboard.
Then you have one dashboard for all customers and just have to add customer_id:xxx to the search query and all widgets will be updated to the value with the customer.
The query for each widget is then "( {Dashboard search} ) AND ( {widget query} )".
In this way all widgets have the filter in it and its not needed to add this to all widget. Also it works if no parameter is given.
In our use case we would use source, but anyway with the search box this filter is very flexible.
In my case I want to embed the dashboard in a separate app automatically, so I need to pass params in the request. Presenting default data that wouldn't be applicable to the current view in the external app and making the user add a separate search term seem like a bad experience to me.
@nathanhruby good point, splitted my idea in a new issue: #4501
+1
I'd also request for a parameter to specify the "relative time" for the. Not sure if PARAM_RELATIVE_TIME would be a good name for the parameter. This would override the "search relative time" configuration for all the widgets on the page. Thus we would not have to build multiple dashboards for say 1H/4H/1D/7D..
Grafana template variables are an excellent implentation of this concept. Essentially we need to define a variable that could be used in search queries on the widgets and also a way to define default values for the variables (i.e. a drop-down of all sources).
This has been fixed in 3.1.0 by OSSing the views, which are now the default search in 3.2.0.
Most helpful comment
+1
I'd also request for a parameter to specify the "relative time" for the. Not sure if PARAM_RELATIVE_TIME would be a good name for the parameter. This would override the "search relative time" configuration for all the widgets on the page. Thus we would not have to build multiple dashboards for say 1H/4H/1D/7D..