Hello, im trying to get the audit logs from a database via API,
I know i can manually download them on the UI but i want to automate the process.
So far I came up with this information:
but there’s some information that is required and I cannot find
Need to know where to find the HOSTNAME, PUBLIC KEY and PRIVATE KEY.
If anyone could point me in the right direction, it would be very appreciated.
In the section titled Manage Programmatic Access to an Organization, it mentioned how to create the public & private keys. You would need to follow all the prerequisites outlined in that page before arriving at this step though.
got the keys but im getting an error 400, invalid hostname.
Where am i supposed to find the hostname? I was trying with the name of the actual database.
When im checking the metrics for my deployments i saw this:
[databasename-shard-xx-xx.xxxxxxx.gcp.mongodb.net:27017] and i thought that was the hostname, cant seem to find anything that would point me in the right direction
I’m so sorry for getting back to you late. I’ve missed this follow up question. Currently there’s no way to filter out results by timeframe. You’d need to do some post processing after downloading the full logs. I’ll pass it as an improvement idea to my colleagues.