Skip to main content
Sumo Logic

Filter with template variables

Learn how to use template variables to dynamically filter dashboard data.

Template variables are a feature of Sumo Logic Dashboard (Beta) that allow you to analyze data on-the-fly. You can apply variables to a dashboard to troubleshoot a problem, and view the updated data in real-time for a fast resolution. This document shows you how to add a new template variable to a dashboard, and then how to edit or delete an existing template variable.

Adding a template variable

Template variables provide the ability for dynamically updating Dashboard (Beta). You can apply variables to a dashboard and re-factor the data being presented on-the-fly. In this task, you will learn how to create a new template variable and apply it to a dashboard.

To add a template variable, do the following:

  1. In the Dashboard (Beta) top menu bar, click the plus (+) sign. The Add Variable dialog appears.

TV_Add+_Variable.png

  1. In the Add Variable dialog, enter a unique Variable Name. Our example variable is called Appliance_Search.  
  1. Select a Data Source:
  • Custom List - a custom set of options
  • Metadata Search - metrics metadata based options 
  • Log Search - logs query based options
  1. Do one of the following:
  • For a Custom List, enter the variables with which you want to filter the dashboard and specify a Default Value. The Default Value is the current variable, and is only applied if there are no matches from the Custom List.

DB_Variable_Custom-List.png

  • For a Metadata Search, click in the Filter field and begin typing. Choose a variable and an associated value as they appear in the drop-down menus. Select all necessary variables, then specify a Key and Default Value. The Key is like a keystone in masonry, it's at the apex of all the variables, and is the value from which all other variables are filtered. The Default Value is the current variable, and is only applied if there are no matches.

 DB_Variable_Metadata-Search.png

  • For a Log Search, click in the Filter field and begin typing. Choose a variable and an associated value as they appear in the drop-down menus. Select all necessary variables, then specify a Key and Default Value. The Key is like a keystone in masonry, it's at the apex of all the variables, and is the value from which all other variables are filtered. The Default Value is the current variable, and is only applied if there are no matches.

DB_Variable_Logs-Search.png

  1. Click Apply.

TV_Add_Metadata-Search_Apply.png

Editing a template variable

This task shows you how to modify an existing template variable in a Dashboard (Beta) so you can rescope your data on the fly. This is helpful for troubleshooting a problem to a fast resolution to the root cause.

To edit a template variable, do the following:

  1. Hover the cursor over the end of the template variable field to display the Details icon.

TV_Edit_select_Edit1.png

  1. Click the Details icon and select Edit from the drop-down menu. The Edit Variable dialog appears.

TV_Edit_select_Edit2.png

  1. Perform steps 2 through 4 in Adding a template variable.
  2. Click Apply and view the resulting data transformations on the dashboard.

Deleting a template variable

This task shows you how you can easily delete a template variable from Dashboard (Beta).

To delete a template variable, do the following:

  1. Hover the cursor over the end of the template variable field to display the Details icon.

TV_Edit_select_Edit1.png

  1. Click the Details icon and select Delete from the drop-down menu. The variable along with the resulting data transformations are automatically removed from the dashboard.

TV_Edit_select_Delete.png