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. You can add a filter of the Filter type to query the numbers of PVs for a specific request method by using dynamic list items. In this topic, the NGINX access log dashboard is used as an example to describe how to add a filter of the Filter type to query the numbers of PVs for a specific request method.
The following figure shows how to add a filter of the Filter 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.
- In the search box, enter a query statement.
- Click 15 Minutes(Relative) to specify a time range for the query. You can select a relative time or a time frame, or customize a time range.Note The query results may contain logs that are generated 1 minute earlier or later than the specified time range.
- Click Search & Analyze.
The following figure shows the query results.
Step 2: Add a chart to a dashboard
The following procedure describes how to add a PV chart to the NGINX Access Log dashboard:
- On the Graph tab, click Add to New Dashboard.
- In the Add to New Dashboard dialog box, configure the following parameters and click OK. For more information about dashboard parameters, see Add charts to a dashboard.
Step 3: Add a filter
To add a filter of the Filter type to query the numbers of PVs for a specific request method, perform the following steps:
- In the left navigation sidebar, click the icon.
- In the Dashboard pane, click NGINX Access Log.
The NGINX Access Log dashboard displays the numbers of PVs per minute.
- In the upper-right corner of the NGINX Access Log page, click Edit. Then, click the icon.
- In the Filter panel, configure the following parameters and click OK.
The following code provides an example of the query statement by using dynamic list items:
*|select distinct request_method
For more information about the filter parameters, see Add a filter.
- Adjust the filter layout on the page and click Save.
- In the Save message, click OK.
The NGINX Access Log dashboard displays the Method Filter filter.
Step 4: Verify the results
(*) and (request_method: DELETE) | SELECT date_format(__time__ - __time__ % 60, '%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 minute for the DELETE method.