After you use Log Service to collect NGINX access logs, you can use a query statement to view the numbers of page views (PVs) per minute. If you want to view the numbers of PVs per 10 seconds, you must modify the query statement. To simplify this operation, you can add a filter of the Replace Variable type on the dashboard. This topic describes how to add a filter of the Replace Variable type to query the numbers of PVs per 10 seconds on the NGINX Access Log dashboard.
Prerequisites
- NGINX access logs are collected. For more information, see Collect logs in NGINX mode.
- Indexes are created for log data. For more information, see Configure indexes.
Procedure
The following figure shows how to add the filter of the Replace Variable type on the NGINX Access Log dashboard.

Step 1: Query number of PVs
The following procedure describes how to query the numbers of PVs per minute by using a query statement:
- Log on to the Log Service console.
- In the Projects section, click the name of the project that you want to view.
- Choose . On the Logstores tab, click the Logstore that you want to view.
- Query the numbers of PVs.
Step 2: Configure a placeholder variable
The following procedure describes how to configure the time range to a placeholder variable:
Step 3: Add a chart to the dashboard
The following procedure describes how to add a PV chart to the NGINX Access Log dashboard:
Step 4: Add a filter
The following procedure describes how to add a filter by using the placeholder variable that you configure:
Step 5: Verify the results
* | SELECT date_format(__time__ - __time__ % 10, '%H:%i:%s') as time, count(1) as count GROUP BY time ORDER BY time
The NGINX Access Log dashboard displays the numbers of PVs per 10 seconds.
