Reputation: 3547
I've created several elastic datasources in Grafana Elastic-fido2-${vertical}-events
How can I load it based on the $vertical variable so I use the same visual and not one for each $vertical?
I found this on grafana forum: https://community.grafana.com/t/how-to-use-template-variables-in-your-data-source/63250, but I do not find anywhere to add it in datasource or visual.
Upvotes: 0
Views: 2092
Reputation: 13421
You cannot switch between different data sources based on unrelated variable.
But you can add Data source variable, that will allow you switch between data sources dynamically. And if you want to have a separate variable that contains a part of selected data source, you'll need to manage a bit of trickery with variable chaining.
How (and even if) it can be done depends on data sources available to you. Here is a general overview. But I'm afraid that if Elastic is the only type of data sources available to you at the moment, you wouldn't be able to create said variable chaining, and will be forced to fave to separate variables: one for data source and one for vertical
, whatever it is.
Upvotes: 0