All Products
Search
Document Center

Global Accelerator:Work with access logs

Last Updated:Aug 01, 2024

Global Accelerator (GA) supports the access log feature provided by Simple Log Service. The feature allows you to record user behavior, obtain information about the geographical distribution of users, and troubleshoot issues.

Introduction to access logs

You can create access logs for one or more endpoint groups of a GA instance. The collected log data is delivered to the Logstores provided by Simple Log Service in the regions where the endpoint groups are deployed. An access log entry contains the following information: the source IP address, source port, destination IP address, destination port, and acceleration region. For more information about the fields, see Field description.

image

Use scenarios

  • Identify issues

    You can troubleshoot issues based on the information in an access log.

    For example, you can check whether GA returns an expected response based on the status field in an access log and identify the cause of the issue.

  • Plan your business

    You can analyze an access log to make informed business decisions.

    For example, you can upgrade bandwidth plans in advance to meet business requirements based on the traffic trend in an acceleration area, downgrade bandwidth plans to reduce costs, and view the hosts that access your application within a specified time period to plan for application upgrades based on the http_host field in the access log.

Description

You are not charged additional fees for using the access log feature. You only need to pay for Simple Log Service. For more information, see Billing of Simple Log Service.

Limits

  • The access log feature is supported only in regions where Simple Log Service is available. For more information, see Supported regions.

  • Only standard GA instances support the access log feature. Basic GA instances do not support the access log feature. In this topic, a standard GA instance is used as an example.

  • You cannot collect the access log of an endpoint group if the endpoint group is deployed on a point of presence (PoP) node of Alibaba Cloud.

  • You cannot query the domain names of endpoints.

  • If you cannot use the access log feature, your instance may be using an earlier version. Contact your account manager to upgrade your GA instance.

Create an access log

Before you create an access log for a GA instance, make sure that listeners and endpoint groups are added to the GA instance. For more information, see Add and manage intelligent routing listeners.

  1. Log on to the GA console.

  2. On the Instances page, click the ID of the GA instance that you want to manage.

  3. On the instance details page, click the Access Log tab.

  4. On the Access Log tab, click Create Access Log. In the Storage Configuration dialog box, configure the following parameters and click OK.

    创建访问日志

    Parameter

    Description

    Select Source

    Listener ID/Name

    Select a listener.

    Endpoint Group ID/Name

    Select a destination endpoint group.

    Storage Settings

    Region

    By default, the region where the endpoint group resides is selected.

    Project

    A project in Simple Log Service is used to isolate and manage resources.

    You can click Select Project to select an existing project. You can also click Create Project to create a project.

    Logstore

    Select the Logstore that you want to use to collect, store, and query log data in Simple Log Service.

    You can click Select Logstore to select an existing Logstore. You can also click Create Logstore to create a Logstore.

    Note

    When you perform this operation, the system checks whether the service-linked role AliyunServiceRoleForGaFlowlog is assigned to GA.

    • If the service-linked role AliyunServiceRoleForGaFlowlog does not exist, the system automatically creates the service-linked role and attaches the policy AliyunServiceRolePolicyForGaFlowlog to the service-linked role. This allows GA to access Simple Log Service and deliver flow logs to Simple Log Service.

    • If the service-linked role AliyunServiceRoleForGaFlowlog is assigned to GA, the system does not recreate the role.

    For more information, see AliyunServiceRoleForGaFlowlog.

    After the access log is created, you can view the access log on the Access Log tab.访问日志列表

More operations

Operation

Description

View an access log

  1. On the Access Log tab, find the access log that you created and click View Log in the Actions column to go to the Simple Log Service console.

  2. View and analyze the access log. For more information, see Examples.

Delete an access log

  1. On the Access Log tab, find the access log that you want to delete and click Delete in the Actions column.

  2. In the Delete Log message, click OK.

After Simple Log Service collects an access log, you can download, deliver, and process the access log. You can also create alert rules for the access log. For more information, see Common operations on logs of Alibaba Cloud services.

Examples

View a raw access log

On the Raw Logs tab of the Logstore page, you can view information about raw access logs.

For example, you can click the client_ip field to view client IP addresses.查看访问日志

Query a specified access log

On the Logstore page, enter an SQL statement in the Search & Analyze search box to search for a specified access log.

For example, you can query the distribution of client IP addresses by performing the steps in the following figure.热力图

No.

Description

Enter the following SQL statement to query the heat map of client IP addresses and view the top 10 regions where the clients are distributed. This helps you plan your business.

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

Select a time range during which access logs are generated and click Search & Analyze.

On the Graph > Properties tab, click the 高德热力图 icon to view the distribution of client IP addresses.

Log fields

The following table describes the fields of access logs that you can query in the Simple Log Service console.

Field

Description

accelerator_region

The acceleration region.

client_ip

The IP address of the client, which is the source IP address.

client_port

The port of the client, which is the source port.

egress_bytes

The outbound traffic during the time period when traffic information is collected.

endpoint_group_id

The ID of the endpoint group.

endpoint_group_region

The region where the endpoint group is deployed.

endpoint_ip

The IP address of the endpoint, which is the destination IP address.

endpoint_port

The port of the endpoint, which is the destination port.

ga_id

The ID of the GA instance.

ingress_bytes

The inbound traffic during the time period when logs are created.

listener_id

The ID of the listener.

protocol

The network transmission protocol that is used by the listener.

status

The status of the response packet that is sent by GA.

time

The time when the log entry was generated.

upstream_connect_time

The connection duration.

upstream_first_byte_time

The time to first packet.

The following fields are available when HTTP and HTTPS listeners are used.

Field

Description

http_host

The Host header of the request.

http_referer

The HTTP Referer header of the request that is received by GA.

request_method

The request method.

request_uri

The URI of the request that is received by GA.