All Products
Search
Document Center

ApsaraDB for MongoDB:Modify operation types for audit logs

Last Updated:Mar 27, 2026

ApsaraDB for MongoDB lets you choose which operation types to include in audit logs. Logs for excluded types are not uploaded, which reduces audit storage costs.

Prerequisites

Before you begin, ensure that you have:

Impacts

If you disable the audit log feature for specific operation types, ApsaraDB for MongoDB ignores the operations of these types during auditing. However, the audit logs that are generated for the operation types before the feature is disabled are retained. You can still query the logs to backtrack issues related to the corresponding feature. For more information, see View audit logs.

Supported operation types

The available operation types vary by instance type and node.

Sharded cluster instances

Sharded cluster instances support filtering by node type.

db node — Records requests routed to the current node. Use this to analyze slow queries and view business loads.

Operation typeDescription
adminO&M operations
slowSlow query operations
queryQuery operations
insertInsert operations
updateUpdate operations
deleteDelete operations
commandProtocol commands, such as the aggregation method

mongos node — Records requests sent to mongos nodes, which may be executed on any database. Use this for traffic statistics and audit operations.

Operation typeDescription
adminO&M operations
slowSlow query operations
insertInsert operations
updateUpdate operations
deleteDelete operations

Replica set instances

Operation typeDescription
adminOperations & maintenance (O&M) operations
slowSlow query operations
queryQuery operations
insertInsert operations
updateUpdate operations
deleteDelete operations
commandProtocol commands, such as the aggregation method

Update audit log filters

  1. Log on to the ApsaraDB for MongoDB console.

  2. In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances.

  3. In the upper-left corner, select the resource group and region of the instance.

  4. Click the instance ID, or click Manage in the Actions column.

  5. In the left-side navigation pane of the instance details page, choose Data Security > Audit Logs.

  6. In the upper-right corner, click Audit Log Filter Setting.

  7. In the Audit Log Filter Setting panel, select the operation types to audit.

  8. Click Submit.

API reference

OperationDescription
ModifyAuditLogFilterModifies the operation types for which audit logging is enabled on an ApsaraDB for MongoDB instance
DescribeAuditLogFilterQueries the operation types for which audit logging is enabled on an ApsaraDB for MongoDB instance