You can configure a trend chart to analyze the trends of log data. This topic describes how to configure a trend chart.
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: Query the number of page views (PVs) of a web page. Make sure that log data is integral and accurate.
Configure a trend chart: Add a trend chart named
statistical-chart
, configure a comparison value for the chart, and add the 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 the following query statement in the search box to query the number of PVs of a web page and click Search & Analyze to view the logs.
SELECT count(*) AS PV group by __time__
Step 2: Configure a trend chart
1. Add a trend 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. Specify a title for the trend chart
On the right side of the Edit Chart page, choose statistical-chart
in the Basic Configurations section.
3. Configure the trend chart
On the right side of the Edit Chart page, set the Color Mode parameter to Background and the Image Mode parameter to Trend Chart in the Chart Style section.
: Select Background to specify the color for the background and the trend chart. By default, green is used.
: Select Trend Chart to display the trend chart.
4. Configure a comparison value
On the right side of the Edit Chart page, configure parameters in the Search & Analysis Settings section. On the left side of the Edit Chart page, configure the query time range, Logstore, and query statement for the trend chart based on the following figure. After you complete the configuration, click Apply in the upper part of the Edit Chart page to view the configuration effects of the trend chart.
: SelectPV
to display the field in the trend chart.
: SelectPV
to determine the field whose value is added with a description.
: SelectPV
to determine the field whose value is compared with the value of the Displayed Fields parameter.
: Entercompared to last month
to specify the description of the comparison value.
: Selectpercent(1-100)
to specify the display format of the comparison value.
5. Save the trend 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.