Queries the operational log of an ApsaraDB for Redis instance.

You can also query operational logs in the ApsaraDB for Redis console. For more information, see Query the operational log 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 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 start of the time range that is specified to query the operational log. 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 that is specified to query the operational log. 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.

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

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

Note
  • This parameter is available for only read/write splitting or cluster instances of ApsaraDB for Redis.
  • If you 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 maximum number of entries to return on each page. Valid values: 30, 50, and 100. Default value: 30.

PageNumber Integer No 1

The page number of the page to return. The value must be an integer greater than 0. 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 that is used to match log entries.

OrderType String No asc

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

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

The region ID of the instance.

Response parameters

Parameter Type Example Description
Engine String Redis

The database engine of the instance.

InstanceId String r-bp1zxszhcgatnx****

The ID of the ApsaraDB for Redis instance.

Items Array of LogRecords

The log entries that are returned.

LogRecords
Content String CONFIG REWRITE executed with success.

The content of the operational log.

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

The time when the log entry 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 ApsaraDB for Redis instance.

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

The ID of the node.

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

The page number of the page returned.

PageRecordCount Integer 5

The number of log entries returned on the current page.

PageSize Integer 30

The maximum number of log entries returned on each page.

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

The ID of the request.

StartTime String 2018-12-03T07:01Z

The start of the time range that is specified to query the operational log.

TotalRecordCount Integer 5

The total number of log entries 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 UTC. Example: 2011-06-11T16:00Z.

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