Reputation: 3
Grafana version - v7.5.3
I have two “custom” variables -
env
- has following values: test,prod
instanceidtest
- someid
instanceidprod
- anotherid
JSON example:
“targets”: [
{
"alias": "cpu",
"dimensions": {
"InstanceId": "$instanceid${env}"
},
I want to template variable in another variable something like this - $instanceid${env} to become $instancetest
Upvotes: 0
Views: 3417
Reputation: 22311
Create just one custom variable called "env" like the following:
Values: test: someid,prod: anotherid
Note: the spaces are important
To get the id accordingly with the selected env use: ${env:value}
See this answer for more details.
Upvotes: 2