All Products
Search
Document Center

Simple Log Service:Configure a trend chart

Last Updated:Dec 16, 2024

You can configure a trend chart to analyze the trends of log data. This topic describes how to configure a trend chart.

Prerequisites

Configuration effect

image

  1. Query and analyze data: Query the number of page views (PVs) of a web page. Make sure that log data is integral and accurate.

  2. 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

  1. Log on to the Simple Log Service console. In the Projects section, click the project that you want to manage.

    image

  2. In the left-side navigation pane, click Log Storage. In the Logstores list, click the Logstore that you want to manage.

    image

  3. 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 Dashboard > Dashboards. 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 Add > Add Chart.

image

2. Specify a title for the trend chart

On the right side of the Edit Chart page, choose General Configurations > Chart Types > image. Then, set the Title parameter to statistical-chart in the Basic Configurations section.

image

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.

  • General Configurations > Chart Style > Color Mode: Select Background to specify the color for the background and the trend chart. By default, green is used.

  • General Configurations > Chart Style > Image Mode: Select Trend Chart to display the trend chart.

image

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.

  • General Configurations > Search & Analysis Settings > Displayed Fields: Select PV to display the field in the trend chart.

  • General Configurations > Search & Analysis Settings > Description Field: Select PV to determine the field whose value is added with a description.

  • General Configurations > Search & Analysis Settings > Compared Field: Select PV to determine the field whose value is compared with the value of the Displayed Fields parameter.

  • General Configurations > Search & Analysis Settings > Comparison Result Description: Enter compared to last month to specify the description of the comparison value.

  • General Configurations > Search & Analysis Settings > Compare Value Format: Select percent(1-100) to specify the display format of the comparison value.

image

5. Save the trend chart and the dashboard

  1. In the upper-right corner of the Edit Chart page, click OK.

    image

  2. In the upper-right corner of the dashboard page, click Save.

    image