tencent cloud

ドキュメントCloud Log Service

Downloading Log

ダウンロード
フォーカスモード
フォントサイズ
最終更新日: 2026-06-02 18:59:39

Overview

CLS allows you to export the collected log data, so you can download the data to view it locally. The log download feature is as described below:
Up to 50 million logs can be downloaded at a time.
It allows you to specify search criteria and a time range.
It supports JSON, CSV, and TXT export formats.
Note:
SQL is not supported in log download statements. To download SQL results, go to the upper-right corner of the Statistical Charts TAB page and click Export Analysis Data.

Billing description

Downloading logs incurs public network read traffic fees. CLS calculates the fees based on the size after gzip compression. For example: if your original log size is 100 GB, the size after compression is approximately 40 GB - 70 GB (depending on the source log characteristics). Fees are calculated based on this data volume. For specific pricing, see Product Pricing.

Directions

1. Log in to the CLS console.
2. On the left sidebar, select Search and Analysis to go to the Search and Analysis Management page.
3. In the topic list on the left, select the log topic you want to search.
4. Click Log Time to select the time for log search. You can select the latest time or relative time or customize the time range.
5. Enter the search criteria and click

to search for relevant logs.
6. After log data is retrieved, click Download in the upper-right corner of the log list.
Note:
If no log data is retrieved, the log download feature is unavailable.
The configurations are described as follows:
Downloading as JSON
Downloading as CSV
Downloading as TXT
Configuration Item
Description
Time Range
Select in the upper-right corner of the search and analysis page. It is brought in by default here.
Search Statement
Enter in the input box on the search and analysis page. It is brought in by default here.
Total Log Count
If the number exceeds 50 million, you can split it into multiple download tasks, or configure a value less than 50 million in the Number of logs field below.
Data Format
JSON.
Log Sorting
In descending order of time.
In ascending order of time.
Select Field
Disable the switch to download all fields.
Enable the switch to customize the fields you need to download. By default, index fields are used as JSON nodes. You can manually add or delete fields. A maximum of 300 fields are supported.
Log Quantity
All.
Custom Quantity.
Configuration Item
Description
Time Range
Select in the upper-right corner of the search and analysis page. It is brought in by default here.
Search Statement
Enter in the input box on the search and analysis page. It is brought in by default here.
Total Log Count
If the number exceeds 50 million, you can split it into multiple download tasks, or configure a value less than 50 million in the Number of logs field below.
Data Format
CSV.
Log Sorting
In descending order of time.
In ascending order of time.
Select Field
Enable the switch to customize the fields you need to download. The total number of downloaded fields cannot exceed 300 (by default, index fields are used as CSV headers. You can manually add/delete fields).
Disable the switch to download data with index fields as CSV headers.
Separator
The delimiter between fields in a CSV file can be a space, tab, comma, semicolon, or vertical bar.
Note:
When a field value contains a delimiter, double quotes are used by default to enclose the field value, which may be incorrectly identified during data reading. For example, if the delimiter is a comma and the user_2 field value also contains a comma, double quotes are used by default to enclose this field value.
Raw data: {"user_1":"WangXiaoli (Wang Xiaoli)","user_2":"Wang, Xiaoli (Wang Xiaoli)"}
CSV format after download: user_1,user_2, WangXiaoli (Wang Xiaoli),"Wang, Xiaoli (Wang Xiaoli)"
Invalid Field Filling
When a field does not exist (is invalid), it is filled with a user-specified value. The selectable values are: empty, Null, or custom.
Key in First Line
Whether to write field names to the first row of the CSV file. Not written by default.
Log Quantity
All.
Custom Quantity
Configuration Item
Description
Time Range
Select in the upper-right corner of the search and analysis page. It is brought in by default here.
Search Statement
Enter in the input box on the search and analysis page. It is brought in by default here.
Total Log Count
If the number exceeds 50 million, you can split it into multiple download tasks, or configure a value less than 50 million in the Number of logs field below.
Data Format
TXT.
Log Sorting
In descending order of time.
In ascending order of time.
Select Field
Enable the switch to customize the fields you need to download. (Index fields are used as TXT headers by default, and you can manually add/delete fields). The maximum number of fields is 300.
Disable the switch to download data with index fields as TXT headers.
Separator
The delimiter between fields in a TXT file can be a space, tab, comma, semicolon, or vertical bar.
Note:
When a field value contains a delimiter, double quotes are used by default to enclose the field value, which may be incorrectly identified during data reading. However, you can select single quotes or leave it empty in the escape character to enclose the field value. For example, if the delimiter is a comma and the user_2 field value also contains a comma, double quotes are used by default to enclose this field value.
Raw data: {"user_1":"WangXiaoli (Wang Xiaoli)","user_2":"Wang, Xiaoli (Wang Xiaoli)"}
TXT format after download: user_1,user_2, WangXiaoli (Wang Xiaoli),"Wang, Xiaoli (Wang Xiaoli)"
Escape Character
If a field value contains a delimiter character, wrap the character with an escape character to prevent it from being misidentified during data reading. Supported escape characters are single quotation marks, double quotation marks, or empty.
Note:
When a field value contains a delimiter, double quotes are used by default to enclose the field value. If you select empty in the escape character, the field value will not be enclosed. Pay attention to this when processing the TXT file subsequently.
Raw data: {"user_1":"WangXiaoli (Wang Xiaoli)","user_2":"Wang, Xiaoli (Wang Xiaoli)"}
TXT format after download: user_1,user_2, WangXiaoli (Wang Xiaoli),Wang, Xiaoli (Wang Xiaoli)
Invalid Field Filling
When a field does not exist (is invalid), it is filled with a user-specified value. The selectable values are: empty, Null, or custom.
First-line key
Whether to write field names to the first row of the TXT file. Not written by default.
Log Quantity
All.
Custom Quantity.
Note:
When the number of log entries to be downloaded exceeds 50 million, it is recommended to narrow the search scope (for example, use more precise search conditions or reduce the query time range) or download only a specified number of logs.
If you need to download more than 50 million log entries, you can create multiple download tasks by dividing the overall time range into smaller segments and download the data in batches.
7. Click Export to switch to the Download Records page. Task statuses include Waiting, File Generation in Progress, and File Generated. A newly created download task will enter the File Generation in Progress status after a short wait and start generating data files in the backend. If multiple download tasks are created at the same time, the system will execute them in the order of their creation time. Tasks created later will be in the Waiting status.
8. After the task status changes to File generated successfully, click Download to export logs.
Note:
Exported log files are retained for only 3 days. The file download link is valid for 1 hour. If the link expires, you need to regenerate it.
For a single log topic, a maximum of 2 tasks can be in the "File Generation in Progress" status. Other unfinished tasks are in the "Waiting" status and are queued for execution. If a task is no longer needed, you can click Delete to remove it.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック