百度智能云

All Product Document

          CDN

          Log Download and Dump

          Overview

          CDN is featured with complete log management and download, and you can query, download or store CDN log files automatically according to the actual situations, and push the log in real time.

          Description of Log Field

          The log formats of downloading, one-key dumping or auto storing are the same, and the contained fields are also the same, the detailed field descriptions are as follows:

          Field Meaning
          client_ip Client IP
          log_level Is it an edge log
          - Reserved field
          host Access domain name
          time_local Time string
          request_time_ms Request processing time, in ms
          request Request method, path and version, such as “GET /path/of/url? args&a=1&b=2 HTTP/1.1"
          status HTTPStatus code
          bytes_sent Length of the returned byte
          body_bytes_sent Body length returned
          referer Request Referer
          cookie Client-side Cookie
          user_agent Request UA, namely, the User-Agent part in the request Header
          x_forwarded_for That is, the X-Forward-For part in request Header
          connection_id Unique id of the request
          udf_hit Hit status, such as MISS/HIT
          server_ip Server IP

          Download Logs

          1. Log in CDN Management Console, select Log Management.

            image.png

          2. Select the domain name for which logs have to be downloaded, and you can select single or multiple domain names.
          3. Select the log timeline to check and download. After selecting the timeline, the system displays the logs during the time period. Baidu AI Cloud saves 180 days’ log data.
          4. Select the needed log to load, click Download, to download the log to local disk.

            image.png

          Set to dump by One Click

          1.Log in CDN Management Console, select Log Management.

          2.Select the domain name for which logs have to be downloaded, and you can select single or multiple domain names.

          3.Select the log timeline to check and download. After selecting the timeline, the system displays the logs during the time period. Baidu AI Cloud saves 180 days’ log data.

          4.Select all the logs or the logs required to download, click One-Key Storage

          5.Select the dump path.

          image.png

          Note: You can select the existing Bucket for dumping, or can create a Bucket for log dumping.

          6.After completing the path selection, click OK, the log will be dumped to BOS Bucket.

          7.After successfully submitting the dump request, you can check the corresponding status ang process in Dump Records as shown in the following figure.

          image.png

          Set Automatic Dump

          CDN provides automatic dump feature that can be set up in the console, and then you can manage and store the log situations. The automatic log dump is disabled by default. After the automatic log dump is enabled, you can select the dump path and the domain name of the logs to be dumped automatically.

          The advantages of setting log auto-dump are as follows; you can set according to the actual situation:

          • Logs are permanently stored and not deleted.
          • BOS provides abundant operating tools, which facilitate the management and download of logs.
          • Use BMR to analyze data.

          Operation steps

          1. Log in CDN Management Console, select Log Management.
          2. Click Set Log Automatic Dump , and select corresponding domain name and dump path.

            image.png

          • Adjust the automatic log dump button to "ON".
          • One or more domain names can be set to be automatic log dump.
          • You can select the existing Bucket or create a new Bucket to automatically dump the CDN log files.
          1. Click Confirm to complete the settings. After you complete the automatic dump setting for the domain name, the system automatically dumps the log file of the domain name to the BOS Bucket which has been set.

          Custom Log Format

          You can custom the log format according to the different requirements for log fields and sequence.

          1. Log in CDN Management Console, select Log Management.
          2. On the page of Log Management, click Custom Log Format.

            image.png

          3. On the Custom Format page, set the custom format of the log.

          Note: One domain name can only have one format, and in case of repeated settings, the domain name is precedent to tag, and the remaining are subject to the latest creation time.

          Configure Description
          Log name You can set custom log names to facilitate your viewing and management of logs.
          Adaptable objects You can select the appropriate object for this log format through the domain name or tag.
          Domain name: You can select applicable object by domain name, and it supports to select a single or multiple domain names.
          Tags: You can use tags to select applicable objects and all domain names under multiple or single tags are supported to select.
          Separator You can set the separator for the field in the log generated, and you can select 6 different separators, namely "spacing", “;”, “/”, “~”, “@@” and “\t”.
          Field Fields are divided into candidate fields and selected fields.
          Field to be selected: The field to be selected is that you have not selected yet. You can select single or multiple fields and click to add them to the selected field.
          Selected field: The fields selected are those you have selected currently.
            You can click behind the field to delete a single field, or click to fully delete and delete all fields selected.
            You can click after the field, to add quotation marks to the field.

          4.Click OK to save the setting.

          The optional field of the custom log format is interpreted as follows (please refer to Log Field Description for default field description):

          Field Meaning
          remote_addr Client IP: client port
          remote_ip Client IP
          remote_port Client pot
          sent_http_content_length Content-Length
          http_content_length Content-length sent from client
          sent_http_content_type The body type responded, such as "image/jpeg"
          sent_http_content_range The range header responded, such as "bytes 0-800/801"
          http_range Request Range, such as "bytes=0-795427"
          request_time Request processing time, in seconds
          ssl_protocol ssl protocol, such as "TLSv1.2"
          ssl_cipher ssl key suite, such as "ECDHE-RSA-AES128-GCM-SHA256"
          Server_protocol request protocol, "HTTP/1.0", "HTTP/1.1", or "HTTP/2.0"
          http_accept The data type that the sending end (client) wants to accept
          scheme http/https
          req_len Number of bytes requested by the client received
          url Request URL eg: http://host/path?args
          request_method Request mode, such as GET or POST
          uri Request URI eg: /path? args
          http_ver eg: HTTP/1.1
          http_referer Referer in request Header
          http_cookie Cookie in the request Header
          http_user_agent User-Agent in request Header
          http_x_forwarded_for X-Forward-For in request Header
          connection Connection series number, auto-increment on standalone
          udf_hit Hit or not, hit: HITNo hit: MISS
          jvip Node vip
          Previous
          Porn Detection
          Next
          Dynamic Acceleration Log