You can configure multiple query statements for a statistical chart. This way, multiple single value charts can be displayed in a statistical chart based on the results of the query statements. You can also configure personalized display settings on the Field Configuration tab. This topic describes how to configure a statistical chart that supports multi-statement query.
Prerequisites
Data is collected. For more information, see Collect text logs from servers.
Indexes are created. For more information, see Create indexes.
A dashboard is created. For more information, see Create a dashboard.
Configuration effect
Query and analyze data: In the Simple Log Service console, query the numbers of unique visitors (UVs) and page views (PVs) of a web page. Make sure that log data is integral and accurate.
Configure a statistical chart that supports multi-statement query: Add a statistical chart to display the numbers of
UVs
andPVs
of the web page. Display the background colors of the single value charts forUVs
andPVs
to orange and blue and add the statistical chart to a dashboard.
Step 1: Query and analyze data
Log on to the Simple Log Service console. In the Projects section, click the project that you want to manage.
In the left-side navigation pane, click Log Storage. In the Logstores list, click the Logstore that you want to manage.
On the page that appears, enter query statements and click Search & Analyze to view the logs.
Query the number of UVs.
status < 400 | SELECT approx_distinct(client_ip) AS UV
Query the number of PVs.
status < 400 | SELECT count(*) AS PV
Step 2: Configure a statistical chart that supports multi-statement query
1. Add a statistical chart
In the left-side navigation pane, choose
. In the Dashboard list, click the dashboard that you want to manage. In the upper-right corner of the dashboard page, click Edit. In edit mode, choose .2. Configure multi-statement query
On the right side of the Edit Chart page, choose
based on the following figure. On the left side of the Edit Chart page, configure the query time range, Logstores, and query statements for the statistical chart. After you complete the configuration, click Apply in the upper part of the Edit Chart page to view the configuration effects of the statistical chart.UV to display the UV field in the results of Query Statement A in the statistical chart.
: SelectPV to display the PV field in the results of Query Statement B in the statistical chart.
: Select
3. Specify colors
On the right side of the Edit Chart page, click the Field Configuration tab and specify colors for the statistical chart. For more information, see Single value chart (Pro).
A: In the A section, set the Standard Configurations > Color Scheme parameter to Solid and specify orange for the results of Query Statement A.
B: In the B section, set the Standard Configurations > Color Scheme parameter to Solid and specify blue for the results of Query Statement B.
4. Save the statistical chart and the dashboard
In the upper-right corner of the Edit Chart page, click OK.
In the upper-right corner of the dashboard page, click Save.