DescribeLogAnalysisStatistics
1. API Description
Domain name for API request: teo.intl.tencentcloudapi.com.
This API is used to query log analysis statistics results. Users append an SQL aggregation statement after the query statement ([retrieval condition] | [SQL statement]). The backend executes the aggregation and returns columnar statistics results (column definition + data row).
A maximum of 20 requests can be initiated per second for this API.
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 Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: DescribeLogAnalysisStatistics. |
| Version | Yes | String | Common Params. The value used for this API: 2022-09-01. |
| Region | No | String | Common Params. This parameter is not required. |
| ZoneId | Yes | String | Site ID. |
| Area | Yes | String | Data ownership region. Available values:
|
| LogType | Yes | String | Log type. Available values:
|
| StartTime | Yes | Timestamp ISO8601 | Start time. Example value: 2020-04-29T00:00:00Z. The maximum span from the query start time to this day varies by package version. For details, see Package Selection Comparison. |
| EndTime | Yes | Timestamp ISO8601 | End time, for example, 2020-04-30T00:00:00Z. The maximum time span from start time to end time per request is 31 days. |
| Query | Yes | String | Statistical query statement, composed of [retrieval criteria] | [SQL statement]. The SQL segment after the pipe character "|" is required. The retrieval criteria segment can be empty (for example, | SELECT ...), which means aggregation on full data. Maximum length: 12 KB. Default SQL Limit: 100. Maximum Limit: 10000. With retrieval criteria: Without retrieval criteria: |
3. Output Parameters
| Parameter Name | Type | Description |
|---|---|---|
| Columns | Array of String | Column names in the log analysis statistical result, corresponding to the fields in the SELECT part of the SQL in the input parameter Query. |
| Records | Array of StatisticsRecord | Rows of data in the log analysis statistics result. The value index in each row corresponds one-to-one with the column index. |
| RequestId | String | The 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 Query log analytics statistical results grouped by cache status for a specified site within a time range
This example shows you how to query the statistical results of Layer 7 Access Logs for a query site (ZoneId = zone-3qcox8or8ccl) on the Chinese mainland from 2026-07-14T00:00:00Z to 2026-07-18T00:00:00Z. The statistical statement is: select EdgeCacheStatus as status, count(*) as cnt group by status limit 2, and the filter condition is cache status = cache miss or other.
Input Example
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeLogAnalysisStatistics
<Common request parameters>
{
"ZoneId": "zone-3qcox8or8ccl",
"Area": "mainland",
"LogType": "l7-access-logs",
"StartTime": "2026-07-14T00:00:00Z",
"EndTime": "2026-07-18T00:00:00Z",
"Query": "${EdgeCacheStatus} in ['miss','other'] | select EdgeCacheStatus as status, count(*) as cnt group by status limit 2"
}Output Example
{
"Response": {
"Columns": [
"status"
],
"Records": [
{
"Record": [
"miss"
]
}
],
"RequestId": "6d5d22a3-7977-4fb9-b649-c796fd9cf358"
}
}Example2 Query total number of logs for log analysis for a specified site within a time range
This example shows you how to query the statistical results of Layer 7 Access Logs for the Chinese mainland at the query site (ZoneId = zone-3qcox8or8ccl) from 2026-07-14T00:00:00Z to 2026-07-18T00:00:00Z. The statistical statement is: select count(*) as cnt, with no filter conditions.
Input Example
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeLogAnalysisStatistics
<Common request parameters>
{
"ZoneId": "zone-3qcox8or8ccl",
"Area": "mainland",
"LogType": "l7-access-logs",
"StartTime": "2026-07-14T00:00:00Z",
"EndTime": "2026-07-18T00:00:00Z",
"Query": "* | select count(*) as cnt"
}Output Example
{
"Response": {
"Columns": [
"cnt"
],
"Records": [
{
"Record": [
"5"
]
}
],
"RequestId": "d3c0b5e3-b3fa-433e-97e5-9274c5d3167f"
}
}5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
- Tencent Cloud SDK 3.0 for Python
- Tencent Cloud SDK 3.0 for Java
- Tencent Cloud SDK 3.0 for PHP
- Tencent Cloud SDK 3.0 for Go
- Tencent Cloud SDK 3.0 for Node.js
- Tencent Cloud SDK 3.0 for .NET
- Tencent Cloud SDK 3.0 for C++
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.