All Products
Document Center


Last Updated: Jan 29, 2018


Currently, this API supports replica set instances only.

Request parameters

NameTypeRequired or notDescription
ActionStringYesRequired parameter; value: DescribeAuditRecords.
DBInstanceIdStringYesThe input logic name of the primary instance named sharding.
StartTimeStringYesQuery start time, format:yyyy-MM-dd’T’HH:mm:ssZ.
EndTimeStringYesQuery end time, format:yyyy-MM-dd’T’HH:mm:ssZ, must be later than query start time.
NodeIdStringNoSharding can be set to the ID of every Mongos or shard. Otherwise, no result is returned.This parameter is not required for replica set instances.
StartTimeStringYesQuery start time. The format is yyyy-MM-dd’T’HH:mm:ssZ.
EndTimeStringYesQuery end time. The format is yyyy-MM-dd’T’HH:mm:ssZ. It must be later than the query start time.
DatabaseStringNoDefault value: All.
UserStringNoDefault value: All.
FormStringNo- File: Triggers the generation of audit logs. If this parameter is set to File, only public parameters are returned. In this case, you need to call the DescribeSQLLogFiles API to obtain the final download address of audit logs.
- Stream: Default value. Data streams are returned.
QueryKeywordsStringNoQuery keywords. Multiple keywords are separated by spaces. Up to 10 keywords are allowed.
PageSizeIntegerNoNumber of records per page; optional values: 30, 50, and 100. Default value: 30.
PageNumberIntegerNoPage number, which must be greater than 0 but must not exceed the maximum Integer value. Default value: 1.

Response parameters

Public response parameters-For more information, see public response parameters.
TotalRecordCountIntegerTotal number of records.
PageNumberIntegerPage number
PageRecordCountIntegerNumber of SQL log details on this page.
ItemsList<SQLRecord>SQL log details.
TotalRecordCountIntegerTotal number of records.

SQLRecord parameters

DBNameStringDatabase name.
AccountNameStringTotal number of records.
HostAddressStringClient IP address.
SyntaxStringExecuted statement.
TotalExecutionTimesLongTime consumed, in microseconds.
ReturnRowCountsLongNumber of returned records.
ExecuteTime StringExecution time. The format is yyyy-MM-dd’T’HH:mm:ssZ, for example, 2011-05-30 T12:11:20Z.
ThreadIDStringThread ID.