Updated on 2024-11-18 GMT+08:00

Adding a Dashboard Filter

Add filters to a dashboard so that you can filter data or replace data with variables.

Filters are used to modify query criteria for all statistical charts in a dashboard in batches. Each statistical chart is actually the results of a query and analysis statement.

  • Filter type: Filter logs by log field key and value. To apply a filter, add it as a filtering condition before your query and analysis statement, and use AND or NOT to link the condition and statement. For example, Key: Value AND [search query] | [SQL query] indicates that logs containing Key:Value are searched for within the results of the original query and analysis statement. For this filter type, you can select or enter one or more values, which are connected by an OR relationship.
  • Time series filter type: Labels and values are dynamically added for filtering. When adding a filter, you can add filter criteria, which are logically connected by AND.

Prerequisites

  • Logs have been collected.
  • Charts have been added to a dashboard.
  • A log structuring rule has been configured for the log stream. For details, see Setting Cloud Structuring Parsing.

Restrictions

Up to 10 filters can be added for a dashboard.

Adding a Filter

  1. Log in to the LTS console, choose Dashboards in the navigation pane, and select a dashboard.
  2. Click the dashboard name to go to the details page.
  3. Click . On the Filter page, set the filter parameters by referring to Adding a Dashboard Filter.

    Fields of the numeric type cannot be filtered.

    Table 1 Filter parameters

    Parameter

    Description

    Filter Name

    Only letters, digits, underscores (_), hyphens (-), and periods (.) are allowed. It cannot start with a period or underscore, or end with a period.

    Operator

    Specify the relationship between filter criteria and chart query statements. The value can be AND (default) or NOT.

    Key

    The field to be filtered. Use only letters, digits, hyphens (-), underscores (_), and periods (.). Do not start with a period or underscore, end with a period, or use only digits.

    Key Alias

    Alias of the key, which is used to distinguish fields. Only letters, digits, underscores (_), hyphens (-), and periods (.) are allowed. It cannot start with a period or underscore, or end with a period.

    Static Values

    Set the value corresponding to the key. You can click Add multiple times to add more values.

    Set the following parameters for adding a value:

    • Value: name of a value. Only letters, digits, underscores (_), hyphens (-), and periods (.) are allowed. It cannot start with a period or underscore, or end with a period.
    • Alias: alias of the value.
    • Default Value: If you enable this parameter, the value will be set as a default value for the key.
    • Operation: Click to delete the value.

    Add Dynamic Value

    The dynamic values are the query results of the corresponding query and analysis statements. The query results change dynamically in different time ranges.

    • If Add Dynamic Value is disabled, the dynamic change of the query results cannot be set.
    • Enable this parameter to add a dynamic value for the key, displaying the dynamic changes of the query results. Set the following parameters:

      Log Group: Select the log group to be queried.

      Log stream: Select the log stream to be queried.

      SQL Engine Version: Select Pipe character or Non-pipe character. The default SQL query syntax of the pipe character version is * | select *, and that of the non-pipe character version is select *.

      Dynamic Value Source: You can choose fuzzy match or SQL query.

      Fuzzy match: Select structured fields configured for the current log stream.

      SQL query: Enter a SQL query statement. Click Search to preview the dynamic value.

  4. Click OK.