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)
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
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.
In the left-side navigation pane, click .
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.NoteYou 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.NoteYou 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.