All Products
Search
Document Center

Simple Log Service:Configure the map of China

Last Updated:Dec 10, 2024

Simple Log Service enables the use of the ip_to_province function to represent regional data on the map of China. This topic outlines the steps to configure the map of China.

Prerequisites

Step 1: Query and analyze data

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

  2. In the left-side navigation pane, click Log Storage. In the Logstores list, click the logstore you want.

    image

  3. On the page that appears, enter a query statement and click Search & Analyze to view the logs.

    Simple Log Service allows you to display region information collected by the ip_to_country function on the map of China. When you use the ip_to_country function, you must specify ip_to_country(xx,'en').

    * | select ip_to_province(http_x_forwarded_for) as province, count(1) as c group by province order by c desc limit 100000

    image

Step 2: Configure the map of China

  1. 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. On the right-hand side of the Edit Chart page, choose General Configurations > Chart Types > Map. On the left-hand side of the Edit Chart page, you can configure the query time range, logstore, and query statement for the world map. After you complete the configuration, click Apply in the upper part of the Edit Chart page to view the configuration effects.

    • General Configurations > Query and Analysis Configurations > Data Type: Select Region to display the map by region.

    • General Configurations > Query and Analysis Configurations > Area/Area Code: Select Province.

    • General Configurations > Query and Analysis Configurations > Value Column: Select c to display the number of logs in each region.

    • General Configurations > Query and Analysis Configurations > Location: Select National to display all the regions of China.

    image