You need to enable JavaScript to run this app.
Torch Log Service

Torch Log Service

Copy page
Download PDF
Add dashboard filters and variables
Introduction to dashboard filters and variables
Copy page
Download PDF
Introduction to dashboard filters and variables
Dashboard filters and variables allow you to apply additional filters to each chart's data, making it easier to quickly view key fields in statistical analysis. This topic describes the dashboard filter and variable features in TLS.​
Concept introduction​
By default, dashboards in TLS display statistical data for each chart within the selected time range.​
  • Data scope: depends on the time range and query and analysis statement associated with the chart.​
  • Chart link: Filter chart data by creating filters or custom variables and specifying field values to view statistical analysis data of key fields.​
For example, set multiple filters for dashboards related to access logs to filter and select data by source, client IP, HTTP code, and other fields, so you can quickly view analytics results for different sources and client IP addresses.​
Filter and variable types​
The details of filters and variables are as follows:​
​
Type​
Description​
Filter​
Filter by log field names and field values.​
After adding a filter and selecting a field value in the dashboard, TLS adds the specified key-value pairs as additional query conditions before the query and analysis statement. The additional conditions are connected to the original query with AND or NOT logic.​
  • Format of the query and analysis statement after using a filter:​
  • [Key:Value] AND/NOT [search query] | [sql query].​
  • Example:​
  • code:500 AND ip:192.168.1.2 means to query logs with code: 500 in which the ip field equals 192.168.1.2.​
Custom variables​
Filter by specifying variable names and variable values.​
After you add a variable, the variable in the corresponding query and analysis statements for the charts is replaced with the value you select. This applies to all charts in the dashboard where the variable is set.​
Notice​
If you use variables to filter chart data, add variable placeholders to the query and analysis statement when adding charts.​
  • Variable syntax: ${{variable name|default value}}.​
  • Example: id: ${{id|123}} | SELECT __time__ - __time__ %60 AS time, COUNT(*) AS PV GROUP BY time.​
Data source variable​
Filter by specifying variable names and log topic ranges.​
Once you add a data source variable, you can switch variable values, and the specified chart will automatically update query and analysis results based on the log topic you select. Then you can switch chart data sources flexibly.​
Preset variable​
TLS provides preset variables such as __from and __to, which can be used directly in dashboard query and analysis statements, chart titles, and text boxes without creation.​
​
Notice​
The total number of filters, variables, and charts in each dashboard must not exceed 50.​
​
Last updated: 2026.03.11 18:49:43