tencent cloud

ExportInstanceSlowQueries
Last updated: 2025-11-13 20:51:02
ExportInstanceSlowQueries
Last updated: 2025-11-13 20:51:02

1. API Description

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

This API is used to export instance slow logs.

A maximum of 20 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 Name Required Type Description
Action Yes String Common Params. The value used for this API: ExportInstanceSlowQueries.
Version Yes String Common Params. The value used for this API: 2019-01-07.
Region Yes String Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-bangkok, ap-beijing, ap-chengdu, ap-chongqing, ap-guangzhou, ap-hongkong, ap-jakarta, ap-nanjing, ap-seoul, ap-shanghai, ap-shenzhen-fsi, ap-singapore, ap-tokyo, eu-frankfurt, na-ashburn, na-siliconvalley, sa-saopaulo.
InstanceId Yes String Instance ID
StartTime No String Transaction start time
EndTime No String Transaction end time
Limit No Integer Maximum number
Offset No Integer Offset
Username No String Username
Host No String Client host
Database No String Database name
FileType No String File type. Valid values: csv, original.
OrderBy No String Sorting field. Valid values: QueryTime, LockTime, RowsExamined, and RowsSent.
OrderByType No String Sorting order. Valid values: asc, desc.

3. Output Parameters

Parameter Name Type Description
FileContent String Slow query export content
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 Export the Slow Logs of an Instance

Input Example

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

{
    "InstanceId": "cynosdbmysql-ins-93sj6l7d",
    "StartTime": "2024-10-11 16:36:18",
    "EndTime": "2024-10-12 16:36:18",
    "Offset": 0,
    "Limit": 1,
    "Username": "root",
    "Database": "db",
    "FileType": "csv"
}

Output Example

{
    "Response": {
"FileContent": "execution time,SQL statement,client IP address,userName,database name,execution duration (seconds),lock duration (seconds),number of parsed rows,number of rows returned,remote reading count,number of remote read bytes,time spent on remote reads (micros),remote write count,number of remote written bytes,time spent on remote writes (micros),transaction submission delay (micros) 2024-10-11 16:36:18,\"INSERT IGNORE INTO sbtest14(id, k, c, pad) VALUES(NULL, 779102\",1.1.1.1,root,db,1.227114,0.000003,0,0,0,0,0,0,0,0,0"
        "RequestId": "9e56617c-c7cc-44e1-a967-6beb418ad5e7"
    }
}

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

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.OperationFailedError Operation failed. Try again later. If the problem persists, contact customer service.
InvalidParameterValue.InvalidParameterValueError Invalid parameter value.
UnauthorizedOperation.PermissionDenied CAM authentication failed.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback