What do you guys think? Is it a bug or I’m just trying too hard to use it in a way that wasn’t meant to be?
Why I’m trying to use template variables on an ad-hoc variable, well, it’s easy, this would allow me to create an ad-hoc with all the regular variables, hide it and automatically have them apply to my elasticsearch queries, without having to include each variable on each graph.
The drop down functionality only shows me the different values of the field, but I can’t (except writting it myself) set “all” or select “many” like we can for regular template variables.
For example, suppose I have a @host field and I want to select host1.com and host2.com, if I use a regular template variable there is no problem, but I have to add that variable to the query of each graph in my dashboard. If I use an ad-hoc variable I don’t have to add it to every graph, but it’s not flexible enough as a regular template variable to choose values.
I’ve found a workaround while I was typing this answer, but only work for Grafana v5.1+.
I can use advance formatting of the $host variable to turn it into a regex and then use the regex operation (=~) in the ad-hoc variable. It works as expected!
Note: Because of the way the query is created using the ad-hoc variables, the lucene formatting of the variable can’t be used in this problem.
I find it easier (not all of my users are technical) to just tell them to select the values they want from the dropdown.
I don’t follow… wouldn’t multiple ad-hoc filters with different hostnames produce basically empty results? I mean, events are either from hostA or hostB in my case…
I have a post request to send data to influxdb as below:
“curl -s -X POST {TELEGRAF_URL} --data-binary 'ab_loadtest_connect,url={params.TEST_URL},Connect_min={value_min[0]},Connect_max={value_max[0]},Connect_mean={value_mean[0]} {loadtestStartTime}000000’”)
sh(script: “curl -s -X POST {TELEGRAF_URL} --data-binary 'ab_loadtest_processing,url={params.TEST_URL},metric=processing Processing_min={value_min[1]},Processing_max={value_max[1]},Processing_mean={value_mean[1]} {loadtestStartTime}000000’”)
sh(script: “curl -s -X POST {TELEGRAF_URL} --data-binary 'ab_loadtest_waiting,url={params.TEST_URL},metric=waiting Waiting_min={value_min[2]},Waiting_max={value_max[2]},Waiting_mean={value_mean[2]} {loadtestStartTime}000000’”)
I have grafana dashboard plotted but need to templatise the metrics of all of them How do I do that? so as the template will show selective metrics for a time range of for example last 7 days
I have a post request to send data to influxdb as below:
“curl -s -X POST {TELEGRAF_URL} --data-binary 'ab_loadtest_connect,url={params.TEST_URL},Connect_min={value_min[0]},Connect_max={value_max[0]},Connect_mean={value_mean[0]} {loadtestStartTime}000000’”)
sh(script: “curl -s -X POST {TELEGRAF_URL} --data-binary 'ab_loadtest_processing,url={params.TEST_URL},metric=processing Processing_min={value_min[1]},Processing_max={value_max[1]},Processing_mean={value_mean[1]} {loadtestStartTime}000000’”)
sh(script: “curl -s -X POST {TELEGRAF_URL} --data-binary 'ab_loadtest_waiting,url={params.TEST_URL},metric=waiting Waiting_min={value_min[2]},Waiting_max={value_max[2]},Waiting_mean={value_mean[2]} {loadtestStartTime}000000’”)
I have grafana dashboard plotted but need to templatise the metrics of all of them How do I do that? so as the template will show selective metrics for a time range of for example last 7 days