You can call this operation to query active logs of an ApsaraDB for Redis instance.

For more information about how to perform the corresponding operation in the console, see Query active 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 dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String No DescribeRunningLogRecords

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

InstanceId String Yes r-bp1xxxxxxxxxxxxx

The ID of the instance for which you want to query active logs.

StartTime String Yes 2018-12-03T07:01Z

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

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

The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. The end time must be later than the start time.

NodeId String No r-bp1xxxxxxxxxxxxx-db-0

The ID of the child node in the cluster. If you want to query slow logs of a specified node, you must specify this parameter.

DBName String No demo

The name of the database.

RoleType String No master

The role of the node. Default value: master.

PageSize Integer No 30

The number of entries to return on each page.

PageNumber Integer No 1

The number of the page to return

ResourceGroupId String No rg-resourcegroupid1

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 node.
QueryKeyword String No aof

The keyword used to match log entries.

OrderType String No asc

The sorting order of the 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 engine type of the instance.

InstanceId String r-bp1xxxxxxxxxxxxx

The ID of the instance.

Items Array

The active logs that are returned.

LogRecords
Category String NETWORK

The category of the log.

Content String CONFIG REWRITE executed with success.

The content of the log.

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

The time when the log was generated.

InstanceId String r-bp1xxxxxxxxxxxxx

The ID of the instance.

Level String WARNING

The level of the log.

PageNumber Integer 1

The page number of the returned page.

PageRecordCount Integer 5

The number of logs returned on the current page.

PageSize Integer 30

The number of entries returned per page.

RequestId String 093B8579-9264-43A0-ABA9-AA8621FF

The ID of the request.

StartTime String 2018-12-03T07:01Z

The beginning of the time range where active 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-bp1xxxxxxxxxxxxx
&StartTime=2018-12-03T07:01Z
&EndTime=2018-12-03T08:01Z
&<Common request parameters>

Sample success responses

XML format

<DescribeRunningLogRecordsResponse>
	  <Items>
		    <LogRecords>
			      <CreateTime>2019-03-22T08:43:24Z</CreateTime>
			      <Level>WARNING</Level>
			      <Content>CONFIG REWRITE executed with success. </Content>
		    </LogRecords>
	  </Items>
	  <PageNumber>1</PageNumber>
	  <TotalRecordCount>1</TotalRecordCount>
	  <PageSize>30</PageSize>
	  <InstanceId>r-bp1xxxxxxxxxxxxx</InstanceId>
	  <RequestId>AAFCDED7-3FE1-49B2-9E9F-2D66E3D041A8</RequestId>
	  <StartTime>2019-03-20T07:01Z</StartTime>
	  <PageRecordCount>1</PageRecordCount>
</DescribeRunningLogRecordsResponse>

JSON format

{
	"Items": {
		"LogRecords": [
			{
				"CreateTime": "2019-03-22T08:43:24Z",
				"Level": "WARNING",
				"Content": "CONFIG REWRITE executed with success."
			}
		]
	},
	"PageNumber": 1,
	"TotalRecordCount": 1,
	"PageSize": 30,
	"InstanceId": "r-bp1xxxxxxxxxxxxx",
	"RequestId": "AAFCDED7-3FE1-49B2-9E9F-2D66E3D041A8",
	"StartTime": "2019-03-20T07:01Z",
	"PageRecordCount": 1
}

Error codes

HttpCode Error code Error message Description
400 InvalidStartTime.Malformed The Specified parameter StartTime is not valid. The error message returned because the format of the beginning time is invalid. The time must be in GMT. Example: 2011-06-11T16:00Z.
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.