We are trying to export all our Mongo DB database Trigger errors to a collection through ‘Log Forwarder’ module.
Now, we want to take a daily dump of that collection to check the number of errors occurred on daily basis.
Is there any way to achieve this ? In Compass, we have an option to export the collection, however, is there any scheduled process or anything we can configure?
I think from the MongoDB side, the application you are looking for is mongoexport. It is a command-line tool that produces a JSON or CSV export of data stored in a MongoDB instance.
In terms of scheduling jobs:
In Linux, you can use cronjob to run the command automatically daily and use it accordingly.
For Windows, you can use Windows Task Scheduler to schedule a daily task to run this command.
I believe the most straightforward way to achieve what you wanted (daily export of a collection), is to use cronjob/task scheduler to run a script that executes mongoexport with the required parameters.
However if this is not applicable to your use case, please share below details: