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

Torch Log Service

Copy page
Download PDF
Add dashboard filters and variables
Add dashboard filter
Copy page
Download PDF
Add dashboard filter
This topic describes how to add dashboard filters with 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 a filter​
  1. Log in to TLS console.​
  1. Select the region where log service is located from the top navigation bar.​
  1. In the left navigation bar, select Common functions > Dashboard.​
  1. In the dashboard list, click the dashboard under the target project.​
  1. Click the settings icon in the upper-right corner of the page.​
  • ​​​
  1. On the Filters and variables tab, click Add filter.​
  1. On the Create filter panel, configure the following parameters, and click Create filter.​
  • ​
    Parameters​
    Description​
    Filter name​
    Name of the filter. Name can not be changed after the filter is created.​
    This name is for filter management and appears only in the filter list; it will not be displayed on the dashboard.​
    Filter alias (display name)​
    Alias displayed for the filter on the dashboard.​
    For example, set an alias Client IP for field clientIP to enhance the dashboard experience.​
    Field name​
    The field used for filtering.​
    TLS uses this field as the filtering key to filter across the entire dashboard.​
    You can configure this field value through static values or dynamic values parameters.​
    Filter method​
    The method of filtering. Supported settings:​
    • AND: Take the intersection of multiple search results, which means adding specified filter conditions to the chart query statement. The actual effective query and analysis statement is [Value] AND [search query] | [sql query].​
    • NOT: The search results exclude the original chart's specified query statement. The actual effective query and analysis statement is [Value] NOT [search query] | [sql query].​
    Value refers to the field value you configured in the static value or dynamic value parameter.​
    Supports multiple selection​
    Does Value support multiple selection when using the filter?​
    By default, this feature is disabled, which means multiple selection is not supported. When enabled, you can select multiple Values as filter conditions. When multiple options are selected, the filter criteria are connected by OR logic. Value refers to the field value you configured in the static value or dynamic value parameter.​
    Static value​
    Set a static value (Value) for the filter field.​
    TLS adds the static value to the value list of the specified field. You can add multiple static values, and adjust their order by dragging the text box. You can add the following configurations for each static value:​
    • Field value: the field value used for filtering. Supports setting as an asterisk (*), which matches all field values.​
    • Field value alias: the alias displayed for the field value in the filter. It is not required. For example, set the alias Zhang San for the field value zhangsan.​
    • Default selection: Whether this field is selected by default in the filter. By default, this feature is disabled, which means it is not selected. When multi-select support is disabled, only one value can be enabled for default selection.​
    Dynamic value​
    Set dynamic values for the filter field.​
    TLS uses the query and analysis results of the selected log topic as optional field values. Dynamic values change dynamically, and their actual values depend on factors such as the selected time range and query and analysis statements.​
    ​
Example of adding request method filter​
For example, if Chart A displays the number of requests per minute and you want to view the number of requests for each method through Chart A, you can add a request method filter without manually modifying the query and analysis statement.​
  1. Add a chart.​
  • Add chart A to the dashboard before creating a filter. For details, see Add charts to dashboard. The query and analysis statement for chart A is as follows:​
  • ​
    * | SELECT DATE_FORMAT(__time__ - __time__ % 60000, 'HH:mm:ss') AS time, count(*) AS PV GROUP BY time ORDER BY time​
    ​
*Description​
__time__ is a millisecond-level timestamp, so DATE_FORMAT(__time__ - __time__ % 60000, 'HH:mm:ss') aligns the time to the minute.​
  • ​​​
  1. Add filter.​
  • Key parameter description:​
  • Set the name to method.​
  • Set the Filter alias to request method.​
  • Set the Field name to Method.​
  • Select Dynamic value to extract the Method field value from logs by the query and analysis statement. The corresponding query and analysis statement is *| SELECT DISTINCT Method.​
  • ​​​
  1. Save configuration.​
  • At the top right of the Settings page, click Save.​
  • ​​​
  1. Use filter.​
  • After you add a filter, it is displayed in the dashboard. You can filter chart data using the filter. For example, if you select Request method as POST, Chart A will display the number of POST requests per minute.​
  • ​​​
Related operations​
After you add filters and variables, you can conveniently use them in the dashboard, or modify and delete them as needed. For details, see Common dashboard actions.​
​
Last updated: 2026.03.11 18:49:43