- Documentation
Torch Log Service
User Guide
Visualization
Add dashboard filters and variables
Add dashboard data source variables
Add dashboard filters and variables
Add dashboard data source variables
Add dashboard data source variables
This topic explains how to add dashboard data source variables and provides relevant examples.
Prerequisites
- Log data has been collected and indexes are configured. For more details, see Collect log data.
Notice
The total number of filters, variables, and charts in each dashboard must not exceed 50.
Steps to add data source variables
- Select the region where log service is located from the top navigation bar.
- In the left navigation bar, select Common functions > Dashboard.
- In the dashboard list, click the dashboard under the target project.
- Click the Settings icon in the upper right corner of the page.
-
- On the Filters and variables tab, click Add datasource variable.
- In the Create datasource variables panel, configure the following parameters, click Create datasource variables, and then click Save.
Example: Add multiple topic request count variables
For example, project A may have multiple topics and each topic stores access logs for websites A, B, C, and others. When you need to display the number of requests per minute for each log topic using a chart, you can add a data source variable.
- Add a data source variable.
- Here are examples of important configuration items:
- Set Data source variable name as website.
- Set alias (display name) as Website access logs.
- Set Option source as All topics.
-
- At the top right of the Settings page, click Save.
-
- Add chart A to the dashboard. For details, see Add charts to dashboard. Set the data source to data source variable and website access logs (\${{website}}). The corresponding query and analysis statement is as follows:
Notice
- __time__ is a millisecond-level timestamp, so DATE_FORMAT(__time__ - __time__ % 60000, 'HH:mm:ss') aligns the time to the minute.
- After selecting a data source variable, the system will query and analyze based on the log topic you specified when adding the variable, and then generate the result.
-
- Use a data source variable.
- After the variable is added, a variable selection box will show in the dashboard. You can switch the data source (log topic) through the box. For example, when you select different log topics within the website access logs variable, the system automatically updates the query and analysis results based on your selected log topic.
-
After you add filters and variables, you can use them in the dashboard, or you can modify and delete them as needed. For details, see Common dashboard actions.
Last updated: 2026.03.12 16:35:51