Real-time log analysis enables quick retrieval, analysis, and storage of log data through the real-time collection and delivery of CSS access logs to Tencent Cloud Log Service (CLS). This enables you to mine log data for data-driven operations and management, allowing for the rapid and accurate development of operational strategies.
Note:
Real-time log analysis now fully supports shipping logs to Cloud Log Service. This document will guide you on how to use the real-time log feature. Notes
Log data is collected in real-time, with log search and reporting data stabilizing after three minutes.
Currently, reporting analysis is only available for playback logs. If you have other log management needs, visit Cloud Log Service. After enabling the log delivery feature, ensure that your CLS service is in normal operation, as the suspension of CLS will prevent the delivery of logs.
The bandwidth or traffic data recorded in logs is the application layer (HTTP protocol) return data. Due to mechanisms like TCP header consumption and failed retransmissions, it is smaller than the bandwidth or traffic consumption calculated at the TCP layer.
Operation Instructions
Creating a log topic
1. Go to the CSS console and select Monitoring > Cloud Log Service > Real-time log analysis to enter the real-time log analysis page. 2. If this is your first time using this feature, you need to use your CSS service role to grant authorization. After authorization, you need to agree to the service agreement and click Start. The system will automatically activate the CLS product and open the real-time log analysis management page.
3. Choose a region and click the link on the page to create a new logset.
Note:
The region includes Guangzhou and Singapore. Log topics created under the logset in the Guangzhou region can only deliver logs within the Chinese mainland. In contrast, log topics created under the logset in the Singapore region can only deliver logs globally, including to Hong Kong (China), Macao (China), and Taiwan (China).
4. Click Confirm to create a new logset.
5. After successfully creating a logset, click Create Log Topic to enter the log topic creation page. The newly created log topic will by default be in the process of delivering logs to CLS.
Modifying a log topic
1. Enter the log topic list in real-time log analysis and click Manage in the operation column of the log topic you need to modify.
2. Enter the log topic editing page to modify the log topic information.
Analyzing a log report
Only log topics of the log type provide report analysis. There are four types of data on the page: Basic Data Analysis, Resource Distribution Analysis, Exception Diagnosis Analysis, and User Analysis.
1. Enter the log topic list in Real-time Log Analysis and click Report on the right side of the log topic you want to view.
2. Enter the log report page to view report data; you can separately view Basic Data, Resource Distribution, Exception Diagnosis, and User Analysis.
Log Search
Log search supports multiple types of retrieval and analysis methods, as well as various forms of chart analysis. For detailed information, see Log Search and Analysis. Log search is performed based on log topics. Select the log topic you need to search for and click Search to enter the log search page.
Stop shipping a log topic to CLS
1. Enter the log topic list in Real-time Log Analysis and click Stop on the right of the log topic you wish to stop shipping.
2. In the pop-up window, click Confirm to stop shipping. The status of the corresponding log topic will change to "stop shipping", and logs will no longer be shipped to CLS.
Deleting a log topic
Note:
Once a log topic is deleted, it cannot be recovered. Please proceed with caution.
If you delete a log topic, you will stop pushing log data of the related domain, the corresponding log topic in CLS will also be deleted, and all shipped logs will be cleared. Meanwhile, you will no longer be able to use the report associated with that topic.
1. Enter the log topic list in Real-time Log Analysis and click Delete on the right side of the log topic you wish to remove.
2. In the pop-up window, confirm whether to delete the log topic and click OK to proceed.
Log Fields
Push logs
|
1 | time | Request time |
2 | client_ip | Client IP |
3 | host | Accessed domain name |
4 | url | URL |
5 | size | Stream push byte size |
6 | country_id | Country ID |
7 | prov | Province |
8 | isp | ISP |
9 | streamname | Stream ID |
10 | node_ip | Node IP |
11 | server_region | Server region |
12 | server_country | Server country |
Playback logs
|
1 | type | Playback type: lvb represents Live Video Broadcasting and leb represents Live Event Broadcasting |
2 | time | Request time |
3 | client_ip | Client IP |
4 | host | Accessed domain name |
5 | url | URL |
6 | size | Byte size of this access request |
7 | country_id | Country ID |
8 | prov | Province |
9 | isp | ISP |
10 | http_code | HTTP status code |
11 | referer | Referer information |
12 | process_time | Processing duration (in milliseconds) |
13 | ua | User-Agent information |
14 | range | Range parameter |
15 | method | HTTP Method |
16 | streamname | Stream ID |
17 | hit | Cache hit/miss |
18 | node_ip | Node IP (This field may be empty for the IP addresses of certain CDN cluster nodes cannot be obtained.) |
19 | server_region | Server region |
20 | server_country | Server country |
21 | connect_fd | Connection port number |
22 | lost_rate | The packet loss rate, only valid for type=leb |
23 | rtt | Round-trip time, only valid for type=leb |
Note:
The special status codes in the log are as follows:
0: Connection established.
4: Request timed out, authentication timed out, or response timed out.
5: Origin server disconnected or stream terminated.
6: Client disconnected.
Definitions
Logset
A logset classifies log topics and metric topics and can contain multiple log topics and metric topics. A logset itself does not store any log data, it only facilitates user management of topics. CSS logsets have the following basic attribute information:
Region: The region to which a logset belongs. Note:
Guangzhou and Singapore regions are currently supported.
Logset Name: The name of a logset.
Retention period: The default retention period for data in the log set is 30 days.
Creation time: Logset creation time.
Log Topic
A log topic is a basic unit for log data collection, storage, retrieval, and analysis on the CLS platform. The vast amounts of logs collected are managed by log topic, including the configuration of the collection rules and storage time, log search and analysis, and log download, consumption, and delivery.
Log topic features include:
Collect logs to log topics.
Store and manage logs based on log topics.
Search and analyze logs by log topics.
Ship logs to other platforms based on log topics.
Download and consume logs from log topics.
Note:
The information above is excerpted from the CLS product documentation. For more details, see Log Topic and Logset and refer to the CLS documentation for accurate information.
Was this page helpful?