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
Data is collected. For more information, see Collect text logs from servers.
Indexes are created. For more information, see Create an index.
A dashboard is created. For more information, see Quickly create a dashboard.
Step 1: Query and analyze data
Log on to the Simple Log Service console. In the Projects section, click the project you want.

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

-
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
Step 2: Configure a map of China
-
In the navigation pane on the left, choose . In the Dashboards list, click the target dashboard. In the upper-right corner of the dashboard, click Edit. In edit mode, click .

-
On the Edit Chart page, configure the query time range, Logstore, and query statement. In the pane on the right, choose . Configure the general settings as follows. Then, click Apply at the top of the page to preview the chart.
-
: Sets the map to display data by area.
-
: 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 theprovincefield from the query results. -
: Select the field that contains the numeric value for each area. In this example, select the
cfield to display the log count for each area. -
: Sets the geographic scope of the map. To display all areas of China, select the option for the entire country.

-