Queries operational logs of an ApsaraDB for Redis instance.

You can also query operational logs in the ApsaraDB for Redis console. For more information, see Query operational logs of an instance.

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 automatically 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.

InstanceId String Yes r-bp1zxszhcgatnx****

The ID of the instance.

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 beginning time. The time range cannot exceed one day. We recommend that you choose one hour as a time range for your query. Specify the time in the YYYY-MM-DDTHHZ format. The time must be in UTC.

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

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

Note
  • This parameter is available only for read/write splitting instances or cluster instances of ApsaraDB for Redis.
  • To set this parameter, you must also set the CharacterType parameter.
DBName String No 0

The name of the database.

RoleType String No master

The role of the shard that you want to query. Valid values:

  • master: the master node. This is the default value.
  • slave: the 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 does not exceed the maximum value of 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: the proxy node.
  • db: the data node.
  • cs: the config server.
Note If you set this parameter, you must also set the NodeId parameter.
QueryKeyword String No aof

The keyword used to match log entries.

OrderType String No asc

The sorting method of the logs in returned results. Valid values:

  • asc: in the ascending order.
  • desc: in the descending order.
RegionId String No cn-hangzhou

The ID of the region where the instance is deployed.

Response parameters

Parameter Type Example Description
Engine String Redis

The database engine type of the instance.

InstanceId String r-bp1zxszhcgatnx****

The ID of the ApsaraDB for Redis instance.

Items Array of LogRecords

The logs that were returned.

LogRecords
Content String CONFIG REWRITE executed with success.

The content of the log entry.

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

The time when the log entry was generated. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

InstanceId String r-bp1zxszhcgatnx****

The ID of the instance.

PageNumber Integer 1

The page number of the returned page.

PageRecordCount Integer 5

The number of logs that were returned on the current page.

PageSize Integer 30

The maximum number of logs that were returned on each page.

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

The ID of the request.

StartTime String 2018-12-03T07:01Z

The beginning of the time range where operational logs were queried.

TotalRecordCount Integer 5

The total number of logs that were 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

<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

{
	"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

HttpCode 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.