All Products
Search
Document Center

Simple Log Service:Configure a map of China

Last Updated:Jun 08, 2026

Visualize regional data on a China map dashboard using the ip_to_province function.

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 left navigation pane, click Log Storage. In the Logstores list, click the Logstore.

  3. Enter the following query and click Search & Analyze.

    The ip_to_province function maps IP addresses to province names. To return English names, add the 'en' parameter: ip_to_province(client_ip,'en').

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

Step 2: Configure the map of China

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

  2. In the right panel, choose General Configurations > Chart Types > China Map. Set the time range, Logstore, and query statement on the left. Configure other settings on the right, then click Apply to preview.

    • General Configurations > Query and Analysis Configurations > Data Type: Visualizes data by geographic region.

    • General Configurations > Query and Analysis Configurations > Area/Area Code: Region data field (province or municipality). In this example, province.

    • General Configurations > Query and Analysis Configurations > Value Column: Value field for each region. In this example, c (log count).

    • General Configurations > Query and Analysis Configurations > Location: Geographic scope. Set to National to display all of China.