Domain name for API request: cdb.intl.tencentcloudapi.com.
This API is used to perform aggregation statistics on specified data columns in audit log result sets with different filter criteria.
A maximum of 20 requests can be initiated per second for this API.
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: AnalyzeAuditLogs. |
| Version | Yes | String | Common Params. The value used for this API: 2017-03-20. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| InstanceId | Yes | String | Instance ID, which can be obtained through the DescribeDBInstances API. |
| StartTime | Yes | String | Start time of the log to be analyzed in the format of 2023-02-16 00:00:20. |
| EndTime | Yes | String | End time of the log to be analyzed in the format of 2023-02-16 00:00:20. |
| AggregationConditions.N | Yes | Array of AggregationCondition | Sorting conditions for aggregation dimension |
| LogFilter.N | No | Array of InstanceAuditLogFilters | The result set of the audit log filtered by this condition is set as the analysis Log. |
| Parameter Name | Type | Description |
|---|---|---|
| Items | Array of AuditLogAggregationResult | Returned aggregation bucket information set |
| TotalCount | Integer | Number of logs scanned |
| 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. |
Audit log aggregation statistics
POST / HTTP/1.1
Host: cdb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: AnalyzeAuditLogs
<Common request parameters>
{
"InstanceId": "cdb-r9bpb9gs",
"StartTime": "2023-02-16 00:00:20",
"EndTime": "2023-02-16 00:10:20",
"AggregationConditions": [
{
"AggregationField": "host",
"Offset": 0,
"Limit": 3
},
{
"AggregationField": "sqlType",
"Offset": 3,
"Limit": 3
}
]
}
{
"Response": {
"Items": [
{
"AggregationField": "host",
"Buckets": [
{
"Count": 89,
"Key": "100.122.76.176"
},
{
"Count": 10,
"Key": "9.71.156.179"
},
{
"Count": 1,
"Key": "10.0.6.6"
}
]
},
{
"AggregationField": "sqlType",
"Buckets": [
{
"Count": 13,
"Key": "LOGOUT"
},
{
"Count": 5,
"Key": "CREATE"
},
{
"Count": 2,
"Key": "INSERT"
}
]
}
],
"RequestId": "0000000000000-00000-014",
"TotalCount": 100
}
}
Filter and then aggregate audit logs
POST / HTTP/1.1
Host: cdb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: AnalyzeAuditLogs
<Common request parameters>
{
"InstanceId": "cdb-r9bpb9gs",
"StartTime": "2023-02-16 00:00:00",
"EndTime": "2023-02-17 00:00:00",
"AuditLogFilter": {
"SqlTypes": [
"create"
]
},
"AggregationConditions": [
{
"AggregationField": "host",
"Offset": 0,
"Limit": 3
}
]
}
{
"Response": {
"Items": [
{
"AggregationField": "host",
"Buckets": [
{
"Count": 3,
"Key": "100.122.76.176"
},
{
"Count": 2,
"Key": "9.71.156.179"
}
]
}
],
"RequestId": "0000000000000-00000-015",
"TotalCount": 5
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| InternalError.InternalInnerServiceError | Internal service exception. Try again later. |
| InvalidParameter.ControllerNotFoundError | This API was not found. |
| InvalidParameter.ExceptionParam | Parameter exception. |
| InvalidParameter.InvalidParameterError | Invalid parameter value |
| UnsupportedOperation | Unsupported operation. |
フィードバック