Lesson 5: Atlas Security Auditing / Learn
Code Summary: Atlas Security Auditing
The following code shows how to download logs and access the Atlas Activity Feed by using the Atlas CLI.
Downloading Logs
To download logs, use the atlas logs download command with the following:
- The server host
- The log you want to return, which in this case is the
mongodb.gzfile - The
--projectIdoption, which specifies the project ID
atlas logs download ac-fjxzha6-shard-00-01.xkdtcbn.mongodb.net mongodb.gz --projectId <projectId>
Access Atlas Activity Feed
To access the Organization Activity Feed by using the Atlas CLI, issue the atlas events organizations list command followed by the organization ID:
atlas events organizations list --orgId <organizationId>
To access the Project Activity Feed by using the Atlas CLI, issue the atlas events projects list command followed by the project ID:
atlas events projects list --projectId <projectId>