All Products
Search
Document Center

Simple Log Service:Configure a map of China

Last Updated:Mar 25, 2026

Simple Log Service allows you to visualize geographic information on a map of China by using the ip_to_province function. This topic shows you how to configure a 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.

    image

  2. In the navigation pane on the left, click Log Storage. In the Logstores list, click the target Logstore.

    image

  3. Enter the following query statement and click Search & Analyze to view the log data.

    Simple Log Service uses the ip_to_province function to display geographic information on a map of China. To display province names in English, add the 'en' parameter, such as ip_to_province(ip_address,'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 a map of China

  1. In the navigation pane on the left, choose Dashboard > Dashboards. In the Dashboards list, click the target dashboard. In the upper-right corner of the dashboard, click Edit. In edit mode, click Add > Add Chart.

    image

  2. On the Edit Chart page, configure the query time range, Logstore, and query statement. In the pane on the right, choose General Configurations > Chart Type > Map. Configure the general settings as follows. Then, click Apply at the top of the page to preview the chart.

    • General Configurations > Query and Analysis Configurations > Data Type: Sets the map to display data by area.

    • General Configurations > Query and Analysis Configurations > Area (or Area Code): Select the field that represents the area. This field must contain the name of a province or municipality, such as Beijing. In this example, select the province field from the query results.

    • General Configurations > Query and Analysis Configurations > Value Column: Select the field that contains the numeric value for each area. In this example, select the c field to display the log count for each area.

    • General Configurations > Query and Analysis Configurations > Location Area: Sets the geographic scope of the map. To display all areas of China, select the option for the entire country.

    image