I have a dashboard with 2 dashboard variables “$region” and “$customer”.
I created alert Notification template which populates “$customer” with a value found in data from datasource like this:
{{ $var_customer := index .Labels “kubernetes_namespace.labels.deployment-name.keyword” | urlquery }}
At the final lines of Notification template i create a URL to the dashboard with dynamic variable “$var_customer” like this:
{{ $dashboard_url := printf “%s?orgId=%d&timezone=%s&var-customer=%s” $base_url $org_id $timezone $var_region $var_customer }}
So basically “$var_customer” in URL equals “$customer” in the dashboard.
This works fine.
But i havent figured out how to dynamically populate the “$region” variable.
Contrary to “$customer”, the “$region” is a Datasource type variable, not Query type. I cannot extract the region value the same way i extract customer value because region simply does not exist in the data.
The region name is found here:
Is there anyway to extract it and use in Notification template to dynamically populate URL variable?
