Enable log delivery in Rackspace CDN#

You can use the logs generated by Rackspace CDN to analyze the number of requests for each object, the client IP address, and time-based usage patterns (such as monthly or seasonal usage).

Use the Rackspace CDN API to enable the delivery of logs for your service by setting the log_delivery parameter for the create service operation to True.

When logging is enabled, raw logs from the CDN edge are delivered once a day to a Cloud Files container named .CDN_ACCESS_LOGS. If this container does not exist, it is created. These logs remain in Cloud Files until you delete them, even if you subsequently disable logging.

Log files are named according to the following pattern: service name, log date, log hour, and MD5 hash. For example:

www.mywebsite.com/2015/02/01/16/096e6c4473f235db081deb51f42a8d98.log.gz

In this example, www.mywebsite.com is the name of the service, 2015/02/01 is the date (February 1, 2015), and 16 is the hour that the log file was created. There might be multiple files for a given hour because the system splits log files based on both time and log file size. All times in the logs are UTC.

Within the gzip logs, the format of the entries is similar to National Center for Supercomputing Applications (NCSA) combined log format, but without cookies. The dashes (-) denote fields that the NCSA combined log format dictates are present but that Rackspace CDN does not capture. For example:

client_ip - - [day/month/year:hour:minute:second timezone] “method request HTTP_version” return_code bytes_sent “referrer” “user_agent”

The following example shows log entries.

Example: Log entries

173.203.44.122 - - [15/07/2014:20:52:25 +0000] "GET
      /5142b6e5e57f760d7ff4-c591437fc634f2a98934b7738b8b8571.r93.cf1.rackcdn.
      com/image1.png HTTP/1.1" 304 277 "-" "Mozilla/4.0 (compatible;
      MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.
      50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0;
      InfoPath.3; .NET4.0C; .NET4.0E; MS-RTC LM 8; Microsoft Outlook 14.0.
      7109; ms-office; MSOffice 14)"
173.203.44.122 - - [15/07/2014:20:52:25 +0000] "GET
      /5142b6e5e57f760d7ff4-c591437fc634f2a98934b7738b8b8571.r93.cf1.rackcdn.
      com/ email.png HTTP/1.1" 304 278 "-" "Mozilla/4.0 (compatible;
      MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.
      50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0;
      InfoPath.3; .NET4.0C; .NET4.0E; MS-RTC LM 8; Microsoft Outlook 14.0.
      7109; ms-office; MSOffice 14)"
173.203.44.122 - - [15/07/2014:20:52:25 +0000] "GET
      /5142b6e5e57f760d7ff4-c591437fc634f2a98934b7738b8b8571.r93.cf1.rackcdn.
      com/ tiny-email.png HTTP/1.1" 304 277 "-" "Mozilla/4.0 (compatible;
      MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.
      50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0;
      InfoPath.3; .NET4.0C; .NET4.0E; MS-RTC LM 8; Microsoft Outlook 14.0.
      7109; ms-office; MSOffice 14)"
173.203.44.122 - - [15/07/2014:20:59:44 +0000] "GET
      /5142b6e5e57f760d7ff4-c591437fc634f2a98934b7738b8b8571.r93.cf1.rackcdn.
      com/ default.css?ver=3.8.3 HTTP/1.1" 200 17511 "http://www.rackspace.
      com/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML,
      like Gecko) Chrome/35.0.1916.153 Safari/537.36"
173.203.44.122 - - [15/07/2014:20:59:44 +0000] "GET
      /5142b6e5e57f760d7ff4-c591437fc634f2a98934b7738b8b8571.r93.cf1.rackcdn.
      com/ jquery.min.js?ver=3.8.3 HTTP/1.1" 200 8022 "http://www.rackspace.
      com/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML,
      like Gecko) Chrome/35.0.1916.153 Safari/537.36"