Alibaba Cloud CDN collects log data on an hourly basis. You can download the log data of a specific day in the last 30 days for analytics. This topic describes how to download log data. This topic also describes the usage notes and the log fields.
The actual traffic amount that you query by using the monitoring and usage analytics feature or the usage statistics feature in the Alibaba Cloud CDN console or Dynamic Route for CDN (DCDN) console or by calling API operations is different from the traffic amount that is logged. In most cases, the actual traffic amount that you query is 1.1 times the traffic amount that is logged. For more information, see Why is the traffic amount found by using the monitoring and usage analytics feature or the usage statistics feature different from the traffic amount that is logged?
Log update delay: In most cases, log data is generated within 24 hours after an event occurs. In some cases, log data is generated after more than 24 hours.
You can download log data that is generated in the last 30 days. If you want to retain log data for a longer period of time, you can use the log storage feature to store log data to an Object Storage Service (OSS) bucket. For more information, see Use Function Compute to deliver logs.
Naming rule for log files: Accelerated domain name_year_month_day_start time_end time[extension field].gz. The extension field starts with an underscore (_). Example:
Names of specific log files may not contain an extension field. Example:
Log fields and descriptions
Sample log entry
[9/Jun/2015:01:58:09 +0800] 10.10.10.10 - 1542 "-" "GET http://www.aliyun.com/index.html" 200 191 2830 MISS "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://example.com/robot/)" "text/html"
The end time of the user access request.
The first IP address in the X-Forwarded-For request header that is carried in the request, which is client_ip. If the client does not use a proxy to connect to the Alibaba Cloud CDN point of presence (POP), the IP address is used by the client to connect to the POP.Note
The format of the X-Forwarded-For request header is
X-Forwarded-For: <client_ip>, <proxy_ip>.
The second IP address in the X-Forwarded-For request header that is carried in the request, which is proxy_ip. If the client does not use a proxy to connect to the Alibaba Cloud CDN POP, the value of this field is
The response time. Unit: milliseconds.
Indicates the Referer header in HTTP requests.
The request method.
The request URL.
The HTTP status code.
The size of the request. Unit: bytes.
The size of the response. Unit: bytes.
The cache hit status. Valid values:
HIT: The request is a cache hit on POPs and does not need to be redirected to the origin server.
MISS: The request is a cache miss on POPs and must be redirected to L2 POPs or the origin server.
Alibaba Cloud CDN collects log data from POPs, except L2 POPs. If the field value is MISS, back-to-origin information is not provided. In this case, the log data does not show whether a request that is a cache miss is redirected to the origin server.
Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://example.com/robot/)
The User-Agent header.
The file type.Note
Logs of domain names for which you enable the global resource plan do not contain this field.
- Log on to the Alibaba Cloud CDN console.
In the left-side navigation pane, choose .
On the Log Download tab, select a domain name and a date and click Search.
Find the log file that you want to download and click Download in the Actions column.
Related API operations
DescribeCdnDomainLogs: queries the address from which you can download the log data of a domain name.