All Products
Search
Document Center

:Analysis Method of Alibaba Cloud Content Delivery Network Access Log

Last Updated:May 19, 2022

Overview

This article describes how to analyze Alibaba Cloud Content Delivery Network access logs in a Linux environment.

Background information

  1. Log on to the Alibaba Cloud Content Delivery Network console and download log files. For more information about log fields, see Log download.
  2. Upload log files to the local Linux server.
  3. Log on to the local Linux server, execute the following command, query all records with 200 status and output them to the specified file.
    grep -w "200" [$Log_Txt] |awk '{if($9=="206") print $0}' > 200log.txt
    Note :[$Log_Txt] is the downloaded log file.
  4. Execute the following command to retrieve a column in the file.
     cat [$Log_Txt] |awk '{print $12}'
  5. Run the following command to calculate the response size in the log:
    cat [$Log_Txt] |awk 'BEGIN {size=0} {size=size+$11} END{print "endsizeis",size/1024/1024,"M"} '
  6. Run the following command to query the top 10 IP page view:
    cat [$Log_Txt] | awk '{print $3}' |sort|uniq -c|sort -nr |head -10

Application scope

  • CDN