All Products
Search
Document Center

Simple Log Service:Configure a world map

Last Updated:Dec 10, 2024

Simple Log Service allows you to display region information collected by the ip_to_country function in a world map. This topic describes how to configure a world map.

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 in a world map. When you use the ip_to_country function, you must specify ip_to_country(xx,'en').

    * | select ip_to_country(remote_addr) as address, count(1) as count group by address order by count desc limit 10

    image

Step 2: Configure a world map

  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 side of the Edit Chart page, choose General Configurations > Chart Types > World Map. On the left side of the Edit Chart page, 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 of the world map.

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

    • General Configurations > Query and Analysis Configurations > Area/Area Code: Select address to represent a region. The value of the address field is a country, such as China.

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

    image