CreateLogAnalysisDownloadTask

1. API Description

Domain name for API request: teo.intl.tencentcloudapi.com.

This API is used to create a log analysis download task. After creation, you can query the download task via the DescribeLogAnalysisDownloadTasks API.
Note:

  1. Supports up to 50 million log entries per download.
  2. Log files are reserved for 3 days.
  3. When multiple tasks exist at the same time, they are processed sequentially based on task creation time.

A maximum of 10 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter NameRequiredTypeDescription
ActionYesStringCommon Params. The value used for this API: CreateLogAnalysisDownloadTask.
VersionYesStringCommon Params. The value used for this API: 2022-09-01.
RegionNoStringCommon Params. This parameter is not required.
ZoneIdYesString

Site ID.

AreaYesString

Data service area. Available values:

  • mainland: within the Chinese mainland;
  • overseas: global (excluding Mainland China).
Note: If the service area of the site is "global availability zone", you need to query the data of mainland and overseas separately to obtain all data.

StartTimeYesTimestamp ISO8601

Start time, example value: 2020-04-29T00:00:00Z. The maximum span from the supported query start time to this day varies for different package versions. For details, see Package Selection Comparison.

EndTimeYesTimestamp ISO8601

End time, for example, 2020-04-30T00:00:00Z. The time span from the start time to the end time per request is up to 31 days.

LogTypeNoString

Log type. Value range:

  • l7-access-logs: Layer 7 Access Logs;
  • web-attack: managed rule log.
Defaults to l7-access-logs.

ConditionNoString

Log match condition. Maximum length 12KB.

FormatNoString

File format, available values:

  • csv
Defaults to csv.

SortNoString

Time sorting of raw logs. Available values:

  • asc: ascending order;
  • desc: descending order.
Default is desc.

3. Output Parameters

Parameter NameTypeDescription
TaskIdString

Log analysis download task ID.

RequestIdStringThe unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Creating a log analytics log download task

Download the L7 access logs for the selected site with ID "zone-2z55fgysdtmc" in the Chinese mainland region between 2025-07-10 00:00:00 and 2025-07-11 00:00:00 UTC+8, sorted in reverse chronological order, in csv file format.
Log match condition: request domain is "www.example.com" and hit status is "hit" or "cache miss".

Input Example

POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateLogAnalysisDownloadTask
<Common request parameters>

{
    "ZoneId": "zone-2z55fgysdtmc",
    "Area": "mainland",
    "StartTime": "2025-07-10T00:00:00+08:00",
    "EndTime": "2025-07-11T00:00:00+08:00",
    "LogType": "l7-access-logs",
    "Condition": "${RequestHost} in ['www.example.com'] AND ${EdgeCacheStatus} in ['hit','miss']",
    "Format": "csv",
    "Sort": "desc"
}

Output Example

{
    "Response": {
        "RequestId": "88e4f1a4-ee44-42e9-8aa8-a9b1631ecc5e",
        "TaskId": "task-1a4wdeq2wsda"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

There is no error code related to the API business logic. For other error codes, please see Common Error Codes.