Download audit logs

更新时间:
复制 MD 格式

Download audit logs from an ApsaraDB for MongoDB instance to archive, filter, and analyze them locally.

Prerequisites

Before you begin, ensure that you have:

  • An ApsaraDB for MongoDB instance with audit logging enabled (free trial edition activated before January 6, 2022)

Note

Starting January 6, 2022, the pay-as-you-go audit log feature launched in all regions and new free trial applications ended. For details, see [Notice] Official launch of the pay-as-you-go audit log feature and end of free trial applications.

Procedure

  1. Go to the Replica Set Instances or Sharded Cluster Instances page. In the top navigation bar, select the target instance's resource group and region, and then click its instance ID.

  2. In the left-side navigation pane, click Data Security > Audit Logs.

  3. In the log chart area, download audit logs.

    • Download audit logs from a specific chart

      In the upper-right corner of the target chart, click 更多 and select Download Chart Data or Download Chart.

      Note

      You can filter the logs first to download only the content you need.

      • Filter by conditions such as keyword, operation type, or client IP address. For more information, see Query audit logs.

      • Filter by time range. In the upper-right corner of the target chart, click 更多 and select Select Time Range to specify a time range.

      • When you click Download Chart Data, your browser downloads the log entries for the selected area. The file is in .csv format and can be viewed with tools such as Excel.

      • When you click Download Chart, your browser downloads an image of the chart. The file is in .png format and can be viewed with image editing tools.

    • Download the complete audit logs

      In the upper-right corner of the Audit Log Details list, click 更多 and select Download Chart Data.

      Note

      You can also click 更多 in the upper-right corner of the Audit Log Details list and select Select Time Range to specify a time range. This allows you to download logs from that specific period.

      When you click Download Chart Data, your browser downloads the log entries for the selected time range. The file is in .csv format and can be viewed with tools such as Excel.