Change audit settings

更新时间:
复制 MD 格式

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.

Starting from January 6, 2022, the audit log feature is available as a pay-as-you-go edition in all regions. New applications for the free trial edition are no longer accepted. For details, see [Notice] Official launch of the pay-as-you-go audit log feature.

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

  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 where your instance is located.

  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 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

What's next