You can call this operation to query the audit log files of MongoDB instances.

Note This operation is unavailable now.
  • This operation is applicable to replica set instances and sharded cluster instances. DescribeAuditFiles cannot be performed on standalone instances.
  • This operation can only be called 30 times per minute. Do not call this operation at a high frequency. To make frequent calls, use a Logstore. For more information, see manage a Logstore.


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 DescribeAuditFiles

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

DBInstanceId String Yes dds-bpxxxxxxxx

The ID of the instance.

NodeId String No d-bpxxxxxxxx

The ID of the mongos or shards in the specified cluster instance.

Note If you do not specify this parameter, the audit logs of all mongos and shards will be returned.
PageSize String No 30

The number of records on each page. Valid values: 30, 50, 100. the default value is 30.

PageNumber Integer No 1

The number of the page to return. Valid values: any non-zero positive Integer. Default value: 1.

Region ID String No cn-hangzhou

The region ID of the instance. You can call the operation DescribeDBInstanceAttribute to query.

Response parameters

Parameter Type Example Description
Items Array

The information about all audit files.

FileID Integer 406505

The ID of the file.

LogDownloadURL String

The download link for audit log files.

Note If the download link is unavailable, this parameter is empty.
LogEndTime String 2019-03-12T09:23:15Z

The end time of audit logs, in the format of yyyy-MM-dd T HH:mm Z(UTC time).

LogSize Long 98

The size of the audit log file. Unit: Bytes.

LogStartTime String 2019-03-11T08:19:29Z

The start time of the audit log. The time is in the format of yyyy-MM-dd T HH:mm Z(UTC time).

LogStatus String success

The status of the audit log file.

  • Success: The audit log files are archived.
  • Failed: The audit log files failed to be archived.
  • Generating: The audit log files are in the process of being archived.
  • Initializing: Archiving is not started.
PageNumber Integer 1

The page number of the page returned.

PageRecordCount Integer 1

The number of records on the current page.

RequestId String F8CA8312-530A-413A-9129-F2BB32A8D404

The ID of the request.

TotalRecordCount Integer 1

The total number of entries returned.


Sample requests

http(s):// Action=DescribeAuditFiles
&<Common request parameters>

Sample success responses

XML format


JSON format

    "Items": {
        "LogFile": [
                "LogStartTime": "2019-03-11T08:19:29Z",
                "LogEndTime": "2019-03-12T09:23:15Z",
                "LogStatus": "Success",
                "FileID": 406505,
                "LogDownloadURL": "",
                "LogSize": 98
    "PageNumber": 1,
    "TotalRecordCount": 1,
    "RequestId": "F8CA8312-530A-413A-9129-F2BB32A8D404",
    "PageRecordCount": 1

Error codes

HTTP status code Error code Error message Description
404 InvalidDBInstanceClass.NotFound Specified DB instance class is not found. The error message returned when the specified instance type does not exists. Verify the specified instance type.
403 IncorrectDBInstanceType Current DB instance type does not support this operation. The error message returned because the operation is not supported by the current instance type.

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