You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We’re excited to introduce a new dashboard variable type: Scope-Based Variables. Scope-Based Variables act as log filters that can be automatically applied to all or selected panels within a dashboard. This helps you to easily filter data across multiple panels without needing to manually edit each panel’s query to accept the variable. [Learn more](/docs/dashboards/filter-template-variables).
Copy file name to clipboardExpand all lines: docs/dashboards/filter-template-variables.md
+29-2Lines changed: 29 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,19 +21,21 @@ The web interface autocomplete feature for log search variables has the follow
21
21
* It is updated every night for the last 24 hours starting from 10PM PT to the previous day at 10PM PT.
22
22
* Only dashboards that were viewed in the last 3 days are updated.
23
23
* Up to 10,000 log values and 1,000 metric values are displayed.
24
-
* Values for template variables are based on the time range of the Dashboard.
24
+
* Values for template variables (except Scope Based Variable) are based on the time range of the dashboard.
25
+
* New panels added to the dashboard will automatically adopt any existing Scope-based Variable to it.
25
26
26
27
## Show and hide variables option
27
28
28
29
In the Dashboard top menu bar, click the filter icon to show the variables option. The filter icon allows you to toggle if the variables option is displayed or hidden.<br/><img src={useBaseUrl('/img/dashboards/filter-template-variables/Show-and-Hide-filters.png')} alt="Show and Hide filters" style={{border: '1px solid gray'}} width="400" />
29
30
30
31
## Create a template variable
31
32
32
-
There are three types of template variables you can use as a dashboard filter:
33
+
There are four types of template variables you can use as a dashboard filter:
33
34
34
35
* Custom List - a custom set of options
35
36
* Metrics Metadata Search - metrics metadata based options
36
37
* Log Search - logs query based options
38
+
* Scope-based Variable - define scope variables to automatically apply to all log queries
37
39
38
40
### Add a Custom List variable
39
41
@@ -46,6 +48,7 @@ To add a Custom List variable to a dashboard, do the following:
46
48
1. In the **Create Template Variable** panel, enter a unique **Variable Name**. Spaces and special characters, with the exception of an underscore (_), are not allowed in value names.<br/><img src={useBaseUrl('img/dashboards/filter-template-variables/Create-Template-Variable-dialog.png')} style={{border:'1px solid gray'}} alt="Create-Template-Variable-dialog" width="800"/>
47
49
1. Select **Custom List** as the **Variable Type**.
48
50
1.**List Items** are your variable values. Use a comma separated list for variable options, separating individual options with a comma. For example, `small, medium, large`.
51
+
1. (Optional) **Include the option to select all values (\*)** will be selected by default. This includes a wildcard asterisk (\*) in the available options.
49
52
1. (Optional) Provide a **Default Value** for the variable.
50
53
1. Click **Create Template Variable** to apply the variable to the dashboard.
51
54
@@ -61,6 +64,7 @@ To add a Metrics Metadata Search variable to a dashboard, do the following:
61
64
1. Select **Metrics Metadata Search** as the **Variable Type**.
62
65
1. The **Fields (key)** is the metadata field you want to use as the filter.
63
66
1. (Optional) **Filters** allow you to filter the scope of your data before choosing the field you want to use. Click in the **Filter** input, begin typing, and choose a filter from the pop-up list. A list of valid values appears. Select a value for the filter, and add other filters as needed.
67
+
1. (Optional) **Include the option to select all values (\*)** will be selected by default. This includes a wildcard asterisk (\*) in the available options.
64
68
1. (Optional) Provide a **Default Value** for the variable.
65
69
1. Click **Create Template Variable** to apply the variable to the dashboard.
66
70
@@ -76,6 +80,29 @@ To add a Logs Search variable to a dashboard, do the following:
76
80
1. Select **Logs Search** as the **Variable Type**.
77
81
1. Click in the **Query** field and begin typing your query. Select valid options from the pop-up list as they appear until your query is complete.
78
82
1. The **Key** is the metadata field you want to use as the filter. Once a Key is selected the Preview table will show example values based on the query running for the last 15 minutes.
83
+
1. (Optional) **Include the option to select all values (\*)** will be selected by default. This includes a wildcard asterisk (\*) in the available options.
84
+
1. (Optional) Enter a **Default Value** for the variable.
85
+
1. Click **Create Template Variable** to apply the variable to the dashboard.
86
+
87
+
### Add a Scope-based Variable
88
+
89
+
With a Scope-based Variable, you can define a variable that automatically applies to all log queries within the scope of the dashboard or panels. By setting a key while creating the scope variable, you can select values to enable simple filtering for the dashboard. Additionally, you can specify which panels the scope variable applies to for more granular control.
90
+
91
+
:::info
92
+
- The fields in the Scope-based Variable are independent of dashboard and panel time range.
93
+
- Fields in the Scope-based Variable will also contain the FER field keys.
94
+
:::
95
+
96
+
To add a Scope-based Variable to a dashboard, do the following:
97
+
98
+
1. In the Dashboard top menu bar, click the filter icon to show the variables option. The filter icon allows you to toggle if the variables option is displayed or hidden.<br/><img src={useBaseUrl('img/dashboards/filter-template-variables/Show-and-Hide-filters.png')} style={{border:'1px solid gray'}} alt="Show-and-Hide-filters" width="250"/>
99
+
1. In the Dashboard top menu bar, click the **plus (+) icon**. The **Create Template Variable** panel appears.<br/><img src={useBaseUrl('img/dashboards/filter-template-variables/create-dashboard-filter.png')} style={{border:'1px solid gray'}} alt="create-dashboard-filter" width="800"/>
100
+
1. In the **Create Template Variable** panel, enter a unique **Variable Name**. Spaces and special characters, with the exception of an underscore (_), are not allowed in value names.<br/><img src={useBaseUrl('img/dashboards/filter-template-variables/scope-based-variable.png')} style={{border:'1px solid gray'}} alt="scope-based-variable" width="800"/>
101
+
1. Select **Scope-based Variable** as the **Variable Type**.
102
+
1. The **Filds (key)** is the metadata field you want to use as the filter. Once a Key is selected the Preview table will show example values based on the query running for the last 15 minutes.
103
+
1. (Optional) **Display all values available** will be selected by default. If you want to specify any values, deselect this option and enter the required value(s) in section below.
104
+
1. (Optional) **Apply filter to all panels in dashboard** will be selected by default. If you want to apply this variable to secleted panel, deselect this option and select the panels from the dropdown. You can also click on <img src={useBaseUrl('img/dashboards/filter-template-variables/preview-the-panels.png')} style={{border:'1px solid gray'}} alt="preview-the-panels" width="30"/> to preview and select the dashboard panel to which you want to apply this variable.
105
+
1. (Optional) **Include the option to select all values (\*)** will be selected by default. This includes a wildcard asterisk (\*) in the available options.
79
106
1. (Optional) Enter a **Default Value** for the variable.
80
107
1. Click **Create Template Variable** to apply the variable to the dashboard.
0 commit comments