You can modify the operation type for audit logs based on your business requirements. This topic describes how to modify the operation type for audit logs.

Prerequisites

The audit log feature is enabled. For more information, see Enable the audit log feature.

Impacts

If you disable the audit log feature on specific operation types, ApsaraDB for MongoDB ignores the operations of these types during auditing. However, earlier audit logs that were generated for these operation types are retained. You can still view these audit logs and use the logs to resolve functionality issues. For more information, see View audit logs.

Procedure

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the upper-left corner of the page, select the resource group and region to which the instance belongs.
  3. In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances based on the instance type.
  4. Click the ID of an instance, or click More icon in the Actions column corresponding to the instance and select Manage.
  5. In the left-side navigation pane of the instance details page, choose Data Security > Audit Logs.
  6. In the upper-left corner of the page, click Audit Log Filter Setting.
  7. In the Audit Log Filter Setting panel, select the operation types that you need to audit.
    Operation type Description
    admin The O&M operations.
    slow The slow query operations.
    query The query operations.
    insert The insert operations.
    update The update operations.
    delete The delete operations.
    command The protocol commands, such as the aggregation method.
  8. Click Submit.

Related API operations

Operation Description
ModifyAuditLogFilter Modifies the types of operations on which the audit log feature is enabled in an ApsaraDB for MongoDB instance.
DescribeAuditLogFilter Queries the types of operations on which the audit log feature is enabled in an ApsaraDB for MongoDB instance.