How to mass delete Syracuse server logs?

1 minute read time.

Have you used Syracuse scheduler to schedule LDAP sync or Elastic search index update?

Have you noticed that when you try to delete ,for example, the LDAP sync scheduler using below steps you will get:

  1. Open Administration, Usage, Automate, Scheduler. 
  2. Select your scheduler task. 
  3. Click Delete and notice the error that is shows up.



     

The reason for this error is that there are server Logs under Administration, Usage, Automate, Server logs that are linked with this scheduler task.

So one way would be to go to Server logs and delete one log at a time, which is time consuming and hard, and until a method get's developed in front end to delete the Server logs in bulk the only option is to delete the in bulk using MongoDB commands following below steps:

Note: Before attempting below steps make sure you have proper MongoDB back up. 

Server logs entity in Syracuse is actually a MongoDB collection:

  1. Install Robomongo (if you have not it already installed) to connect to your MongoDB.
  2. Connect to your MongoDB. 
  3. In Rovomongo right click on ServerLog collection and click on View Documents.



  4.  Enter below in the command section of Robomongo. This will delete any Server logs that it's description matches  "Update LDAP users from LDAP server"

    db.ServerLog.deleteMany( { "description" : "Update LDAP users from LDAP server" } );



  5. Click on the Play button to execute this command.


Conclusion: Until future enhancement happens you can use deleteMany command in MongoDB to mass delete the server logs so then you can delete your scheduler task.