Skip to main content

How to Automate the Clearing of Orchestrator Logs

Author by Christopher Mank

Awhile back, our Infrastructure Team Lead Nate blogged on how you can manually clear the Orchestrator logs (post can be found here).  Although this is a very quick and simple task to do, in the course of everyone's busy work schedule, it's very easy to forget these routine maintenance tasks until they become a real problem. The solution...automate it.  When it comes to maintenance tasks, the best approach is to automate them to ensure they are being performed correctly every time.  To automate the clearing of the Orchestrator logs, you can follow these simple steps: 1.  In the Orchestrator Runbook Designer, create a new folder and Runbook. 2.  Create a Runbook that looks similar to what is pictured below.  It's a very easy and simple Runbook that will do all the heavy lifting for you. Automate Clear Orchestrator Logs Runbook Image Monitor Date/Time This one is pretty straightforward.  Configure the automation to run at a time that is most convenient for your environment.  I would recommend a time when Orchestrator utilization is at its lowest. Check Schedule Anytime I create a monitor Runbook, I like to pair it with its own Schedule.  This gives you the flexibility down the road to manage the schedule independently from other processes. Check Schedule Link Make sure you configure the link between Check Schedule and Backup Logs to look like what's pictured below.  This tells the Runbook to only proceed if it complies with your given schedule. Check Schedule Orchestrator Conforms to Schedule Image Backup and Clear Logs Here is the SQL script that actually does the work.  The Green section is the SQL code we can use to do a full back of the database before clearing the logs.  You will need to change the file path to something that is relevant for your environment.  The Purple section is the code that actually clears the logs from the database. Clear Orchestrator Logs SQL Script Activity Image Clear Orchestrator Logs SQL Script Activity Connection Image That's all there is to it!  Pretty easy right?  And now you can rest assured your Orchestrator database will not get overloaded with extra log data. Until the Whole World Hears, Christopher


Christopher Mank

Systems Architect