Modify DAS Enterprise Edition (NoSQL compatible) audit logs

更新时间:
复制 MD 格式

ApsaraDB for MongoDB audit logs support multiple operation types. You can audit only the operation types you need to reduce log volume and costs.

Prerequisites

The audit log feature is enabled. For instructions, see Enable audit logs for DAS Enterprise Edition (NoSQL compatible).

Impact

After you stop auditing a specific operation type, the system no longer records that type. Existing logs are not affected and remain available for queries. For more information, see Query audit logs for DAS Enterprise Edition (NoSQL compatible).

Procedure

  1. Sign in to the ApsaraDB for MongoDB console.

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

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

  4. Find your target instance and click its ID, or click Manage in the Actions column.

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

  6. In the upper-left corner of the page, click Audit Settings. In the dialog box that appears, select the operation types to audit, and then click OK.

    • db: Records only the requests routed to the current node. Useful for analyzing slow queries and monitoring workloads. The following table describes the supported operation types.

      Operation type

      Description

      admin

      Administrative operations.

      slow

      Slow queries.

      query

      Query operations.

      insert

      Insert operations.

      update

      Update operations.

      delete

      Delete operations.

      command

      Protocol commands, such as the aggregate method.

    • mongos: Records requests sent to a mongos node, which may target any database in the cluster. Useful for traffic statistics and general auditing. The following table describes the supported operation types.

      Operation type

      Description

      admin

      Administrative operations.

      slow

      Slow queries.

      insert

      Insert operations.

      update

      Update operations.

      delete

      Delete operations.

  7. In the upper-left corner of the page, click Service Settings. In the dialog box that appears, modify the retention period for your audit logs, and then click Submit.

    1. SQL Log Storage Duration (Cold Storage Duration): Sets the retention period for cold storage. Valid values are 30, 180, 365, 1095, and 1825 days.

    2. Hot Storage Duration: Sets the retention period for hot storage. The valid range is 1 to 7 days.

  8. Click OK.

Related APIs

API

Description

ModifyAuditLogFilter

Modifies the audit operation types for an ApsaraDB for MongoDB instance.

DescribeAuditLogFilter

Queries the audit operation types for an ApsaraDB for MongoDB instance.

ModifySqlLogConfig

Enables or configures DAS Enterprise Edition (NoSQL compatible).