Queries the operational logs of an ApsaraDB for Redis instance.

For more information about how to view the operational logs of an instance in the ApsaraDB for Redis console, see View active logs.

This operation can be called up to 100 times per minute.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeRunningLogRecords

The operation that you want to perform. Set the value to DescribeRunningLogRecords.

RegionId String No cn-hangzhou

The region ID of the instance.

InstanceId String Yes r-bp1zxszhcgatnx****

The ID of the instance.

NodeId String No r-bp1zxszhcgatnx****-db-0

The ID of the node in the instance. You can set this parameter to query the operational logs of a specified node.

Note
  • This parameter is available only for read/write splitting and cluster instances of ApsaraDB for Redis.
  • If you set this parameter, you must also set the CharacterType parameter.
StartTime String Yes 2018-12-03T07:01Z

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

EndTime String Yes 2018-12-03T08:01Z

The end of the time range to query. The end time must be later than the start time. The time range cannot exceed one day. We recommend that you specify 1 hour. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

DBName String No 0

The name of the database.

RoleType String No master

The role of the data shard. Default value: master. Valid values:

  • master: master node
  • slave: replica node
PageSize Integer No 30

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

PageNumber Integer No 1

The number of the page to return. The value must be an integer that is greater than 0 and less than or equal to the maximum value supported by the integer data type. Default value: 1.

ResourceGroupId String No rg-acfmyiu4ekp****

The ID of the resource group.

CharacterType String No proxy

The shard type of the cluster instance. Valid values:

  • proxy: proxy node
  • db: data node
  • cs: config server node
Note If you set this parameter, you must also set the NodeId parameter.
QueryKeyword String No aof

The keyword that is used to query operational logs.

OrderType String No asc

The method that is used to sort the returned log entries. Valid values:

  • asc: ascending order
  • desc: descending order

Response parameters

Parameter Type Example Description
StartTime String 2018-12-03T07:01Z

The beginning of the time range to query.

RequestId String 093B8579-9264-43A0-ABA9-AA86****

The ID of the request.

PageRecordCount Integer 5

The number of log entries returned on the current page.

TotalRecordCount Integer 5

The total number of entries returned.

PageSize Integer 30

The maximum number of entries returned on each page.

InstanceId String r-bp1zxszhcgatnx****

The ID of the instance.

Engine String Redis

The type of the database engine.

PageNumber Integer 1

The page number of the returned page.

Items Array of LogRecords

Details about the log entries.

LogRecords
CreateTime String 2018-12-03T07:07:30Z

The time when the log was generated. The time is in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

InstanceId String r-bp1zxszhcgatnx****

The ID of the instance.

Content String CONFIG REWRITE executed with success.

The content of the log.

NodeId String r-bp1zxszhcgatnx****-db-0

The ID of the node.

Note If a standard instance is queried, (null) is returned.

Examples

Sample requests

https://r-kvstore.aliyuncs.com/?Action=DescribeRunningLogRecords
&InstanceId=r-bp1zxszhcgatnx****
&StartTime=2018-12-03T07:01Z
&EndTime=2018-12-03T08:01Z
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeRunningLogRecordsResponse>
    <TotalRecordCount>1</TotalRecordCount>
    <PageRecordCount>1</PageRecordCount>
    <RequestId>D73451AC-B9BA-46AA-8972-C17B967E****</RequestId>
    <PageSize>30</PageSize>
    <InstanceId>r-bp10noxlhcoim2****</InstanceId>
    <PageNumber>1</PageNumber>
    <StartTime>2020-11-08T02:00Z</StartTime>
    <Items>
        <LogRecords>
            <InstanceId>r-bp10noxlhcoim2****</InstanceId>
            <Content>126732:M 08 Nov 2020 10:02:03.955 # CONFIG REWRITE executed with success.</Content>
            <CreateTime>2020-11-08T02:02:06Z</CreateTime>
        </LogRecords>
    </Items>
</DescribeRunningLogRecordsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TotalRecordCount" : "1",
  "PageRecordCount" : "1",
  "RequestId" : "D73451AC-B9BA-46AA-8972-C17B967E****",
  "PageSize" : "30",
  "InstanceId" : "r-bp10noxlhcoim2****",
  "PageNumber" : "1",
  "StartTime" : "2020-11-08T02:00Z",
  "Items" : {
    "LogRecords" : [ {
      "InstanceId" : "r-bp10noxlhcoim2****",
      "Content" : "126732:M 08 Nov 2020 10:02:03.955 # CONFIG REWRITE executed with success.",
      "CreateTime" : "2020-11-08T02:02:06Z"
    } ]
  }
}

Error codes

HTTP status code Error code Error message Description
400 InvalidEndTime.Malformed The Specified parameter EndTime is not valid. The error message returned because the format of the end time is invalid. The time must be in GMT. Example: 2011-06-11T16:00Z.

For a list of error codes, visit the API Error Center.