All Products
Search
Document Center

Simple Log Service:Add a filter of the filter type

Last Updated:Aug 03, 2026

After you collect NGINX access logs in SLS, you can add dashboard filters to query logs by status code or request method. This topic uses NGINX access logs as examples.

Prerequisites

Use case 1: Filter logs with a status code of 200

When you filter logs with status code 200, the filter transforms the query into status: 200 AND [search query] | [sql query]. The key is status and the value is 200.

  1. In the edit mode of the dashboard, click the Filter Dashboard filter icon icon in the upper-right corner.

  2. In the Filter panel, configure the following settings and click OK.

    • Name: status

    • Type: Filter

    • Key: status

    • Add dynamic list items: enabled; select website_log for Select Logstore

    • Time range: 15min Last 15 minutes

    • Query statement: *|select DISTINCT status

  3. The configured filter:

    The filter displays a dropdown panel for the status field. Available status codes include 200, 306, 304, 202, 204, and 305. The panel supports search and select-all functions.

  4. The following shows the raw data before filtering.

    The following analytic statement is used.

     * | select status, count(*) as c group by status

    Count per status code:

    The query results contain multiple status codes. The status column shows values such as 204, 203, 307, 401, 501, 206, and 207. The c column shows the corresponding request counts: 31, 29, 42, 24, 10, 35, and 27, for a total of 22 records displayed across 2 pages.

  5. Set status to 200 to display only logs with status code 200.

    The resulting analytic statement is as follows.

    (*)and (status: 200)| select status, count(*) as c group by status 

Use case 2: Filter NGINX logs by request method

To exclude GET and POST logs, the filter transforms the query into NOT (request_method: GET OR request_method: POST) AND [search query] | [sql query]. The key is request_method, and the values are GET and POST.

  1. In the edit mode of the dashboard, click the Filter Dashboard filter icon icon in the upper-right corner.

  2. In the Filter panel, configure the following settings and click OK.

    • Name: request_method

    • Type: Filter

    • Key: request_method

    • Query mode: NOT mode

    • Add dynamic list items: enabled; select website_log for Logstore

    • Query statement: *|select DISTINCT request_method; select 15min Last 15 minutes for Time Range

    • Dynamic list items preview: request_method includes POST, GET, PUT, and DELETE

  3. The configured filter:

    The request_method filter dropdown panel lists available HTTP request methods as checkboxes: POST, GET, PUT, DELETE, and HEAD. Multiple selections are supported.

  4. The following shows the raw data before filtering.

    The following analytic statement is used.

    * | select request_method, count(*) as c group by request_method

    Count per request_method:

    • GET: 2446

    • POST: 573

    • DELETE: 244

    • PUT: 609

    • HEAD: 12

  5. Select POST and GET for request_method. Only POST and GET logs are displayed.

    The filtered table shows statistics for request methods other than POST and GET: PUT with 609 requests, DELETE with 244 requests, and HEAD with 12 requests.

    The resulting analytic statement is as follows.

    (*)not (request_method: POST OR request_method: GET) | select request_method, count(*) as c group by request_method