调用 DescribeNormalLogs 接口查询目标 MongoDB 实例在指定时间段内的运行日志或错误日志信息。
同步请求。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
InstanceId | String | 是 | mongo-replica-e405f8e2**** | 实例 ID。 说明 您可以调用 DescribeDBInstances 接口查询目标地域下所有 MongoDB 实例的基本信息,包括实例 ID。 |
Limit | Long | 是 | 10 | 每页记录数,取值范围为 1~1000。 |
Context | String | 否 | 0,1749808482010,210209079374,618991 | 日志记录查询结果的分页查询凭证,用于标记分页位置。 说明
|
PodName | String | 是 | mongo-replica-e405f8e2****-0 | 需要查询日志信息的节点 ID。 说明 您可以调用 DescribeDBInstanceDetail 接口获取指定实例的详细信息,包括实例中各节点的节点 ID 。其中:
|
Sort | String | 否 | DESC | 将查询结果按照日志生成时间升序或降序排列。取值范围如下:
|
LogLevel | String | 否 | RunningLog | 需要查询的日志级别。取值范围如下:
|
Keys | String | 否 | warning error | 检索关键词,用于检索包含关键词的运行日志或错误日志。 说明
|
QueryStartTime | String | 否 | 2025-06-12T08:30:00Z | 查询开始时间,格式为 说明 若该参数留空,实际查询开始时间默认为当前时间 1 小时前的时间(UTC)。 |
QueryEndTime | String | 否 | 2025-06-13T08:30:00Z | 查询结束时间,格式为 说明
|
参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
Total | Integer | 10 | 查询结果总条目数。 |
Datas | Object[] | 符合查询条件的日志列表详情。 | |
Context | String | 0,1749808482010,210209079374,618991 | 日志记录查询结果的分页查询凭证,用于标记分页位置。 |
ListOver | Boolean | false | 日志内容是否已全部加载。取值范围如下:
说明 若 |
首次通过 DescribeNormalLogs 接口查询运行日志(RunningLog)详情,每页返回 10 条记录。
POST https://mongodb.cn-beijing.volcengineapi.com/?Action=DescribeNormalLogs&Version=2022-01-01 HTTP/1.1 Host: mongodb.cn-beijing.volcengineapi.com Content-Type: application/json; charset=utf-8 X-Date: 20201103T104027Z Authorization: HMAC-SHA256 Credential=AK****/20201103/cn-beijing/mongodb/request,SignedHeaders=content-type;host;x-date,Signature=**** { "Limit": 10, "InstanceId": "mongo-replica-e405f8e2****", "PodName": "mongo-replica-e405f8e2****-0", "QueryStartTime": "2025-06-12T09:54:45Z", "QueryEndTime": "2025-06-13T09:54:45Z", "Sort": "DESC", "LogLevel": "RunningLog" }
{ "ResponseMetadata": { "RequestId": "20230604110420010010023228002****", "Action": "DescribeNormalLogs", "Version": "2022-01-01", "Service": "mongodb", "Region": "cn-beijing" }, "Result": { "Context": "0,1749808482010,210209079374,618991", "Datas": [ { "Connection": "conn171", "CreateTime": "2025-06-13T09:54:44Z", "LogType": "NETWORK", "Message": "end connection 172.30.***.***:37948 (14 connections now open)" }, { "Connection": "conn170", "CreateTime": "2025-06-13T09:54:44Z", "LogType": "NETWORK", "Message": "end connection 172.30.***.***:37940 (15 connections now open)" }, { "Connection": "listener", "CreateTime": "2025-06-13T09:54:44Z", "LogType": "NETWORK", "Message": "start control connection, connectionCount is 16" }, { "Connection": "listener", "CreateTime": "2025-06-13T09:54:44Z", "LogType": "NETWORK", "Message": "connection accepted from 172.30.***.***:37948 #171 (16 connections now open)" }, { "Connection": "listener", "CreateTime": "2025-06-13T09:54:44Z", "LogType": "NETWORK", "Message": "start control connection, connectionCount is 15" }, { "Connection": "listener", "CreateTime": "2025-06-13T09:54:44Z", "LogType": "NETWORK", "Message": "connection accepted from 172.30.***.***:37940 #170 (15 connections now open)" }, { "Connection": "conn169", "CreateTime": "2025-06-13T09:54:42Z", "LogType": "NETWORK", "Message": "end connection 172.30.***.***:37694 (14 connections now open)" }, { "Connection": "conn168", "CreateTime": "2025-06-13T09:54:42Z", "LogType": "NETWORK", "Message": "end connection 172.30.***.***:37688 (15 connections now open)" }, { "Connection": "listener", "CreateTime": "2025-06-13T09:54:42Z", "LogType": "NETWORK", "Message": "start control connection, connectionCount is 16" }, { "Connection": "listener", "CreateTime": "2025-06-13T09:54:42Z", "LogType": "NETWORK", "Message": "connection accepted from 172.30.***.***:37694 #169 (16 connections now open)" } ], "ListOver": false, "Total": 10 } }
已通过 DescribeNormalLogs 接口查询了运行日志(RunningLog)详情,但查询结果并未全部加载(即接口返回结果中的 ListOver 为 false),您可以通过前一次返回结果中的分页标志符(即返回结果中的 Context 值,本文示例中该值为 0,1749808482010,210209079374,618991),再次调用该接口查询剩余的日志详情,每页记录数为 10。
POST https://mongodb.cn-beijing.volcengineapi.com/?Action=DescribeNormalLogs&Version=2022-01-01 HTTP/1.1 Host: mongodb.cn-beijing.volcengineapi.com Content-Type: application/json; charset=utf-8 X-Date: 20201103T104027Z Authorization: HMAC-SHA256 Credential=AK****/20201103/cn-beijing/mongodb/request,SignedHeaders=content-type;host;x-date,Signature=**** { "Limit": 10, "InstanceId": "mongo-replica-23fc14ec****", "PodName": "mongo-replica-23fc14ece7ce-0", "Context": "0,1749808482010,210209079374,618991", "QueryStartTime": "2025-06-12T09:54:45Z", "QueryEndTime": "2025-06-13T09:54:45Z", "Sort": "DESC", "LogLevel": "RunningLog" }
{ "ResponseMetadata": { "RequestId": "20230604110420010010023228002****", "Action": "DescribeNormalLogs", "Version": "2022-01-01", "Service": "mongodb", "Region": "cn-beijing" }, "Result": { "Context": "0,1749808479728,210209079360,618991", "Datas": [ { "Connection": "listener", "CreateTime": "2025-06-13T09:54:42Z", "LogType": "NETWORK", "Message": "start control connection, connectionCount is 15" }, { "Connection": "listener", "CreateTime": "2025-06-13T09:54:42Z", "LogType": "NETWORK", "Message": "connection accepted from 172.30.***.***:37688 #168 (15 connections now open)" }, { "Connection": "conn166", "CreateTime": "2025-06-13T09:54:40Z", "LogType": "NETWORK", "Message": "end connection 172.18.***.***:59318 (14 connections now open)" }, { "Connection": "conn167", "CreateTime": "2025-06-13T09:54:40Z", "LogType": "NETWORK", "Message": "end connection 172.18.***.***:59338 (15 connections now open)" }, { "Connection": "listener", "CreateTime": "2025-06-13T09:54:40Z", "LogType": "NETWORK", "Message": "start control connection, connectionCount is 16" }, { "Connection": "listener", "CreateTime": "2025-06-13T09:54:40Z", "LogType": "NETWORK", "Message": "connection accepted from 172.18.***.***:59338 #167 (16 connections now open)" }, { "Connection": "listener", "CreateTime": "2025-06-13T09:54:40Z", "LogType": "NETWORK", "Message": "start control connection, connectionCount is 15" }, { "Connection": "listener", "CreateTime": "2025-06-13T09:54:40Z", "LogType": "NETWORK", "Message": "connection accepted from 172.18.***.***:59318 #166 (15 connections now open)" }, { "Connection": "conn164", "CreateTime": "2025-06-13T09:54:39Z", "LogType": "NETWORK", "Message": "end connection 172.18.***.***:58870 (15 connections now open)" }, { "Connection": "conn165", "CreateTime": "2025-06-13T09:54:39Z", "LogType": "NETWORK", "Message": "end connection 172.18.***.***:59030 (14 connections now open)" } ], "ListOver": false, "Total": 10 } }
更多详情,请参见错误码。