Atlas cli downloads an empty audit log but from ui i can download log with data inside it

As i mentioned on the header, atlas cli downloads an empty audit log but when i download it from ui, i can download the actual real audit data. My api key is organization owner.

Cluster Information:
Dedicated
M30
Azure, Netherlands

API key is not the problem! I know this because the same api key is used for different dbs and there is no problem like this cluster. How can i solve this problem?

tl;dr:
Audit log download returns empty via atlas cli.

HI @Emre_BASARAN could you re-run the command with --debug and share the command you used along with the debug output, please?

$ atlas logs download  atlas-vvtp2i-shard-00-00.vjcsh.mongodb.net mongodb-audit-log.gz --projectId [PROJECT_ID]

2025/09/08 09:53:35 
GET /api/atlas/v2/groups/[PROJECT_ID]/clusters/atlas-vvtp2i-shard-00-00.vjcsh.mongodb.net/logs/mongodb-audit-log.gz HTTP/1.1
Host: cloud.mongodb.com
User-Agent: atlascli/1.43.0 (linux;amd64;native)
Accept: application/vnd.atlas.2023-02-01+gzip
Accept-Encoding: gzip


2025/09/08 09:53:35 
HTTP/1.1 200 OK
Content-Disposition: attachment; filename="atlas-vvtp2i-shard-00-00.vjcsh.mongodb.net_2025-09-07T06:53:35.000000473_2025-09-08T06:53:35.000000473_MONGODB_AUDIT_LOG.log.gz"
Content-Type: application/vnd.atlas.2023-02-01+gzip
Date: Mon, 08 Sep 2025 06:53:35 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: mdbws
Strict-Transport-Security: max-age=31536000; includeSubdomains;
X-Content-Type-Options: nosniff
X-Envoy-Upstream-Service-Time: 289
X-Frame-Options: DENY
X-Mongodb-Service-Version: gitHash=ca8c1faafcf9080b4f0c15657d26ce7903b34902; versionString=v20250827
X-Permitted-Cross-Domain-Policies: none
Content-Length: 0


Download of mongodb-audit-log.log.gz completed.
telemetry: events: [{2025-09-08 09:53:35.814634234 +0300 +03 m=+1.296090182 atlascli map[HostName:native UserAgent:atlascli/1.43.0 (linux;amd64;native) alias:download arch:amd64 auth_method:api_key ci:false cli_event_type:cmd cli_user_type:default command:atlas-logs-download device_id:12d2d983075eaa65ecd114cd814525e77af9365139a9a6b5a887a5565419eced duration:683 flags:[debug projectId] git_commit:ec31e0754b44250b7350504df8daee7e926bc2e3 installer:deb org_id:63b3d7a91c1d2c2293640816 os:linux output:plaintext profile:default project_id:[PROJECT_ID] result:SUCCESS service:cloud skip_update_check:true version:1.43.0]}]
request:
POST https://cloud.mongodb.com/api/private/v1.0/telemetry/events
response:
HTTP/1.1 202 Accepted
Strict-Transport-Security: max-age=31536000; includeSubdomains;
Referrer-Policy: strict-origin-when-cross-origin
X-Permitted-Cross-Domain-Policies: none
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
Content-Length: 0
X-Envoy-Upstream-Service-Time: 21
X-Mongodb-Service-Version: gitHash=ca8c1faafcf9080b4f0c15657d26ce7903b34902; versionString=v20250827
Vary: Accept-Encoding
Server: mdbws
Date: Mon, 08 Sep 2025 06:53:36 GMT

Thank you, let me investigate and get back to you

Thank you Jonny. Waiting to hear from you.

@Emre_BASARAN please can you confirm that for [PROJECT_ID] you have enabled “Database Auditing” via the Atlas UI? Instructions on how to check / set this are here: Set Up Database Auditing - Atlas - MongoDB Docs

1 Like

That is the main problem i guess. Thank you!

1 Like