Retrieving MongoDB Atlas Logs

Hello!

I am Mariano Koremblum a Software Engineer at Wazuh Inc. We are looking forward to integrating MongoDB Atlas with our project, more specifically, we are trying to get logs from the platform (through the API) to be processed. We have been taking a look into the Events docs but could not find a way to filter logs by timestamp or date or any other useful way. Our idea is to obtain the new logs on regular periods of time, but without having to collect previous logs every time.

Could someone tell me whether this is possible at the moment or not? Does anyone have some recommendations regarding this?

Thanks in advance :slight_smile:

Hi @Mariano_Koremblum - Welcome to the community :smiley:

We are looking forward to integrating MongoDB Atlas with our project, more specifically, we are trying to get logs from the platform (through the API) to be processed. We have been taking a look into the Events docs but could not find a way to filter logs by timestamp or date or any other useful way.

For both Organizational and Project level events, you can utilise the Atlas API and specify the following in the query parameters of the request:

  • minDate - Earliest Timestamp in ISO 8601 date and time format in UTC from when Atlas should return events.
  • maxDate - Latest Timestamp in ISO 8601 date and time format in UTC from when Atlas should return events.

The above documentation I have linked is for events from the Atlas platform as you have mentioned. However, if you are wanting process and audit logs from the mongod / mongos level for a cluster(s) on Atlas, you may refer to the MongoDB Atlas Logs API documentation. You can optionally specify a startDate and endDate when performing the requests.

Hope this helps.

Best Regards,
Jason

2 Likes

Thank you very much Jason! It worked nicely. And also thank you for the documentation links.

Best Regtards,

Mariano

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.