Global Variables are reusable, pre-saved variables you can use in any Real Browser or API Check.
To learn how to create and save Global Variables, see Create a Global Variable.
To learn about Concealed Global Variables, for which the value is permanently concealed from all users of your Splunk Synthetic Monitoring account, see Create a Concealed Global Variable.
Concealed Global Variables and public Global Variables are referenced in the same way.
Prerequisites
- To use a Global Variable, you need Manager access in a Splunk Synthetic Monitoring account.
- You also need to have at least one Global Variable created and saved.
Use a Global Variable in a Real Browser Check
You can use a Global Variable to fill in fields on the steps page or in custom headers under the Advanced tab of a Real Browser Check. Global Variables cannot be used in cookies or any other fields on the Advanced tab.
While editing a Check, click the [i]
icon to view a list of built-in variables and pre-set Global Variables you can use.
Follow these steps to add a variable to your Check:
- While creating or editing a Real Browser Check, go to the Steps tab.
- Under Action, select Fill in field from the dropdown menu.
- Under Value, enter the key for the Global Variable you want to use, preposed by the env. prefix and enclosed in double curly braces. For example, to reference a Global Variable with the key
dev-username
, enter{{env.dev-username}}
in the Value field. - Finish editing or creating the Check.
- Click Create or Save.
Use a Global Variable in an API Check
You can use a Global Variable to fill in any field in an API Check. For instance, you can use a Global Variable to provide a URL for any request, a header value, or any other value.
To reference a Global Variable, enter the key for the Global Variable you want to use, preposed by the env. prefix and enclosed in double curly braces. For example, to reference a Global Variable with the key staging-url, enter {{env.staging-url}}
in the field.
While editing a Check, click the icon to view a list of built-in variables and pre-set Global Variables you can use.