View the running logs for a MongoDB instance.
Operation description
This API is for instances with the following specification types: general-purpose local disk, dedicated local disk, and cloud disk.
This API is limited to 30 calls per minute. Exceeding this limit triggers rate limiting, so avoid high-frequency calls. For high-frequency operations, use Logstore. For more information, see Manage Logstore.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dds:DescribeRunningLogRecords |
get |
*dbinstance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBInstanceId |
string |
Yes |
The instance ID. Note
If this parameter is set to the ID of a sharded cluster instance, you must also specify the NodeId parameter. |
dds-bpxxxxxxxx |
| NodeId |
string |
No |
The ID of a mongos node or shard node in a sharded cluster instance. Note
This parameter is available only when the DBInstanceId parameter is set to the ID of a sharded cluster instance. |
d-bpxxxxxxxx |
| StartTime |
string |
Yes |
The beginning of the time range to query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time is in UTC. |
2019-01-01T12:10Z |
| EndTime |
string |
Yes |
The end of the time range to query. The end time must be later than the start time. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time is in UTC. Note
The end time can be up to 24 hours later than the start time. Otherwise, the call fails. |
2019-01-01T13:10Z |
| DBName |
string |
No |
The name of the database. |
mongodbtest |
| RoleType |
string |
No |
The role of the node. Valid values:
Note
If the NodeId parameter is set to the ID of a mongos node, the RoleType parameter can only be set to primary. |
primary |
| PageSize |
integer |
No |
The number of entries to return on each page. Valid values: 30 to 100. |
30 |
| PageNumber |
integer |
No |
The page number of the page to return. The value must be an integer that is greater than 0. Default value: 1. |
1 |
| OrderType |
string |
No |
The sort order of the running logs to return. Valid values:
|
asc |
| ResourceGroupId |
string |
No |
The ID of the resource group. |
sg-bpxxxxxxxxxxxxxxxxxx |
| RoleId |
string |
No |
The role ID of the node. You can call the DescribeReplicaSetRole operation to query the role ID. |
651xxxxx |
| QueryKeywords |
string |
No |
The keywords for the query. You can specify up to 10 keywords. Separate multiple keywords with spaces. |
test test2 |
| LogicalOperator |
string |
No |
The logical operator for the keyword-based query. Default value: |
and |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| TotalRecordCount |
integer |
The total number of records. |
2 |
| PageRecordCount |
integer |
The number of records per page. |
30 |
| RequestId |
string |
The request ID. |
45D2B592-DEBA-4347-BBF3-47FF6C97DBBC |
| PageNumber |
integer |
The page number. |
1 |
| Items |
object |
||
| LogRecords |
array<object> |
A list of running log records. |
|
|
object |
|||
| ConnInfo |
string |
The connection information. |
conn18xxxxxx |
| CreateTime |
string |
The time when the log entry was created, in yyyy-MM-ddTHH:mm:ssZ format (UTC). |
2019-02-26T12:09:34Z |
| Category |
string |
The log category. |
NETWORK |
| Content |
string |
The content of the log entry. |
end connection 11.xxx.xxx.xx:3xxxx (0 connections now open)\n |
| Engine |
string |
The database engine. |
MongoDB |
Examples
Success response
JSON format
{
"TotalRecordCount": 2,
"PageRecordCount": 30,
"RequestId": "45D2B592-DEBA-4347-BBF3-47FF6C97DBBC",
"PageNumber": 1,
"Items": {
"LogRecords": [
{
"ConnInfo": "conn18xxxxxx",
"CreateTime": "2019-02-26T12:09:34Z",
"Category": "NETWORK",
"Content": " end connection 11.xxx.xxx.xx:3xxxx (0 connections now open)\\n"
}
]
},
"Engine": "MongoDB"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameterCombination | The end time must be greater than the start time | The start time must be earlier than the end time. |
| 400 | InvalidStartTime.Malformed | The Specified parameter StartTime is not valid. | |
| 400 | InvalidEndTime.Malformed | The Specified parameter EndTime is not valid. | |
| 403 | LogApiFrequencyExceeded | Exceeding the allowed frequency of log api. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.