Retrieves a compressed (.gz) log file that contains a range of log messages for a particular host in an Atlas cluster.


This feature is not available for M0 (Free Tier), M2, and M5 clusters. For more information, see Atlas M0 (Free Tier), M2, and M5 Limitations.


You must be an Owner of the group that the cluster belongs to in order to retrieve the log.

Base URL:


GET /api/atlas/v1.0/groups/{GROUP-ID}/clusters/{HOSTNAME}/logs/mongodb.gz

Request Path Parameters

Parameter Required/Optional Description
GROUP-ID Required Group identifier.
HOSTNAME Required Name of the host.

Request Query Parameters

Field Required/Optional Description
startDate Optional.

Timestamp that specifies starting point for the range of log messages to retrieve.

Default is 24 hours prior to the current timestamp.

endDate Optional. Timestamp that specifies the end point for the range of log messages to retrieve. Default is current timestamp.

Request Body Parameters

This endpoint does not use HTTP request body parameters.

Response Elements

The response includes the following elements:

Field Description
appName MongoDB Cloud
build The SHA that corresponds to the GitHub commit for the Atlas.
links Array of links to related API resources. For more information on links, see Linking.
throttling The field is obsolete and has the value false.


Example Request

curl -X GET -u "username:apiKey" --digest -o downloadedLog.gz \

Example Response

The request should download the log file and save to downloadedLog.gz.