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

Torch Log Service

Copy page
Download PDF
Add dashboard filters and variables
Create variable cascade relationships
Copy page
Download PDF
Create variable cascade relationships
After creating variables, TLS supports configuring cascade relationships between variables to clarify their dependencies. This topic describes how to create variable cascading relationships and use the Format feature.​
Prerequisites​
  • Log data has been collected and indexes are configured. For more details, see .​
  • Dashboard variables have been created.​
Create variable cascade relationships​
Take the creation of the cascade relationship between the name variable and the email variable as an example.​
  1. Create the name variable.​
  1. Create the email variable.​
  • When creating the email variable, reference the name variable in the variable value.​
  • ​​​
  1. Use variables.​
  • The name and email variables are linked. Once you select a value for the name variable, the email variable value is automatically filtered.​
  • ​​​
  • You can also click View variable cascade relationship on the Filters and variables tab to see how variables are cascaded in the current dashboard.​
  • ​​​
Use Format syntax​
TLS supports using Format in variables.​
​
Format​
Description​
time_format​
Format millisecond-level timestamps.​
Supports use with ${{__from}} and ${{__to}} variables. For supported format configurations, see format.​
For example:​
  • ${{__to:time_format("YYYY-MM-DD HH:mm:ss.SSS")}}: Formats the query end time to YYYY-MM-DD HH:mm:ss.SSS.​
  • ${{__from:time_format("DD/MM/YYYY")}}: Formats the query start time to DD/MM/YYYY.​
duration_round_fomart​
Format time intervals and round to the largest integer unit.​
Supports using with the ${{__interval}} variable, which means you can set it as ${{__interval:duration_round_format}}.​
For example:​
  • The system automatically adapts to a time granularity of 2000 milliseconds based on the selected range. After formatting, the largest integer unit is seconds, so the final formatted result is 2s.​
  • The system automatically adapts to a time granularity of 600,000 milliseconds based on the selected range. After formatting, the largest integer unit is minutes, so the final formatted result is 10m.​
tls_search_filter​
Convert variable values into query conditions.​
The format is tls_search_filter("key", "AND")}} or tls_search_filter("key", "NOT")}}, where "key" is the field name, and AND/NOT are logical connectors. Requires use with custom or system preset variables.​
For example:​
  • ${{method:tls_search_filter("method", "AND")}}: Converts the value of the ${{method}} variable into a query condition.​
  • ${{status:tls_search_filter("Status", "AND")}}: Converts the value of the ${{status}} variable into a query condition and uses it in the query and analysis statement.​
  • Query and analysis statement​
  • ​
    * ${{status:tls_search_filter("status", "AND")}} | SELECT DATE_FORMAT(__time__ - __time__ % 60000, 'HH:mm:ss') AS time, count(*) AS PV GROUP BY time ORDER BY time​
    ​
  • Query and analysis results​
  • ​​​
  • ​​​
encode_base64​
Encode the variable value using Base64.​
For example: use ${{method:encode_base64}} to encode the value of the ${{method}} variable.​
​
Related operations​
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.05.20 14:45:21