The audit log feature of ApsaraDB for MongoDB lets you choose which operation types to audit. Deselecting operation types reduces the volume of logs uploaded, which lowers storage costs.
Prerequisites
Before the official launch of the audit log feature, the free trial edition was activated for the instance.
Potential impacts
Disabling auditing for specific operation types stops new logs from being generated for those types. Logs generated before you change the settings are retained and remain queryable. For more information, see View audit logs.
Update audit log filter settings
Step 1: Go to the Audit Log Filter Settings panel
-
Log on to the ApsaraDB for MongoDB console.
-
In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances.
-
In the upper-left corner, select the resource group and region where your instance is located.
-
Click the instance ID, or click Manage in the Actions column.
-
In the left-side navigation pane of the instance details page, choose Data Security > Audit Logs.
-
In the upper-right corner, click Audit Log Filter Settings.
Step 2: Select operation types and save
In the Audit Log Filter Settings panel, select the operation types to audit, then click OK.
The available operation types depend on your instance type.
Replica set instances
| Operation type | Description |
|---|---|
| admin | O&M operations |
| slow | Slow query operations |
| query | Query operations |
| insert | Insert operations |
| update | Update operations |
| delete | Delete operations |
| command | Protocol commands, such as the aggregation method |
Sharded cluster instances
Sharded cluster instances support two audit scopes. Select operation types for each scope independently.
db — Records only requests routed to the current node. Use this scope to analyze slow queries and view business loads.
| Operation type | Description |
|---|---|
| admin | O&M operations |
| slow | Slow query operations |
| query | Query operations |
| insert | Insert operations |
| update | Update operations |
| delete | Delete operations |
| command | Protocol commands, such as the aggregation method |
mongos — Records requests sent to mongos nodes, which may execute on any database. Use this scope for traffic statistics and audit operations.
| Operation type | Description |
|---|---|
| admin | O&M operations |
| slow | Slow query operations |
| insert | Insert operations |
| update | Update operations |
| delete | Delete operations |