All Products
Search
Document Center

Tair (Redis® OSS-Compatible):DescribeSlowLogRecords

Last Updated:Oct 13, 2026

Queries the slow query logs generated by a Tair (Redis® OSS-Compatible) database instance within a specified time period.

Operation description

For the corresponding console operation, see Query slow query logs. The maximum number of calls to DescribeSlowLogRecords is 100 per minute.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

kvstore:DescribeSlowLogRecords

get

*DBInstance

acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#dbInstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The instance ID.

r-bp1zxszhcgatnx****

NodeId

string

No

The node ID in the instance. Specify this parameter to query the slow query logs of a specific node.

Note

This parameter is available only when the instance uses the read/write splitting or cluster architecture.

r-bp1zxszhcgatnx****-db-0

StartTime

string

Yes

The start time of the query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

2019-03-10T14:00Z

EndTime

string

Yes

The end time of the query. The end time must be later than the start time, and the time range cannot exceed 1 day. The recommended time range is 1 hour. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

2019-03-10T15:00Z

DBName

string

No

The database name.

0

PageSize

integer

No

The maximum number of entries to return on each page. Valid values: 30, 50, and 100. Default value: 30.

Valid values:

  • 30 :

    30 entries per page.

  • 50 :

    50 entries per page.

  • 100 :

    100 entries per page.

30

PageNumber

integer

No

The page number. The value must be a positive integer that does not exceed the maximum value of the INTEGER data type. Default value: 1.

1

SlowLogRecordType

string

No

The slow log type. Valid values:

  • proxy: Slow query logs on proxy nodes.

  • db: Slow query logs on data nodes. This is the default value.

Valid values:

  • proxy :

    slow query logs on proxy nodes.

  • db :

    slow query logs on data nodes.

proxy

QueryKeyword

string

No

The keyword used to search the returned results.

keyword1

OrderType

string

No

The sort order of the returned results. Valid values:

  • ASC: ascending order.

  • DESC: descending order. This is the default value.

Valid values:

  • ASC :

    ascending order.

  • DESC :

    descending order.

ASC

OrderBy

string

No

The field based on which the returned results are sorted. Valid values:

  • execution_time: sorts the results based on the start time of request execution. This is the default value.

  • latency: sorts the results based on the execution duration of requests.

execution_time

Response elements

Element

Type

Description

Example

object

StartTime

string

The start time of the query.

The time is in the YYYY-MM-DDTHH:mmZ format and displayed in UTC.

2019-03-10T14:00Z

RequestId

string

The request ID.

686BB8A6-BBA5-47E5-8A75-D2ADE433****

PageRecordCount

integer

The number of log entries returned on the current page.

1

TotalRecordCount

integer

The total number of log entries.

1

PageSize

integer

The maximum number of log entries returned per page.

30

InstanceId

string

The instance ID.

r-bp10n********

Engine

string

The database engine.

Redis

PageNumber

integer

The current page number.

1

Items

object

LogRecords

array<object>

The collection of slow query log entries.

object

Account

string

The account ID.

0

ElapsedTime

integer

The execution duration. Unit: microseconds.

248

Command

string

The slow query statement.

KEYS *

DBName

string

The database name.

0

ExecuteTime

string

The start time of the execution. The time is in the YYYY-MM-DDTHH:mm:ssZ format.

2019-03-12T09:18:41Z

DataBaseName

string

The database name. This field serves the same purpose as DBName. Use the DBName parameter instead.

0

NodeId

string

The node ID.

r-bp1zxszhcgatnx****-db-0

AccountName

string

The account name.

demo

IPAddress

string

The IP address of the client.

172.16.88.***

Examples

Success response

JSON format

{
  "StartTime": "2019-03-10T14:00Z",
  "RequestId": "686BB8A6-BBA5-47E5-8A75-D2ADE433****",
  "PageRecordCount": 1,
  "TotalRecordCount": 1,
  "PageSize": 30,
  "InstanceId": "r-bp10n********",
  "Engine": "Redis",
  "PageNumber": 1,
  "Items": {
    "LogRecords": [
      {
        "Account": "0",
        "ElapsedTime": 248,
        "Command": "KEYS *",
        "DBName": "0",
        "ExecuteTime": "2019-03-12T09:18:41Z",
        "DataBaseName": "0",
        "NodeId": "r-bp1zxszhcgatnx****-db-0",
        "AccountName": "demo",
        "IPAddress": "172.16.88.***"
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidStartTime.Malformed The Specified parameter StartTime is not valid.
400 InvalidEndTime.Malformed The Specified parameter EndTime is not valid.
403 IncorrectEngineVersion Current engine version does not support operations.
403 ServerBusy server busy now, please retry later.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.