Hi all,
Just wanted to share with you some improvements we have made to logging in Python 3 scripting in the latest version of SOAR. This will hopefully help anyone writing scripts, workflows, playbooks or functions. These changes do not apply to Python 2.
When writing scripts, you have access to log statements as described here:
https://www.ibm.com/docs/en/rsoa-and-rp/42?topic=scripts-log-operationsIn previous versions, these log statements were only shown when interactively running a script. In v42 these log messages will also be written to the resilient-scripting.log file to help with debugging Python 3 scripts. The advantage of this is that you can view logs even when the script is run by an automated rule or playbook, and also view the logs of failed scripts.
Here is an example of a simple log statement
Scripts that throw an error will also display logs leading up to the error
And perhaps the most useful part of all, is that scripts in a workflow function can also be logged, meaning the results of a function can be debugged without having to add notes to an incident or any other workaround. You can also log out any of the built in object types such as
incident or
task to view the object data.
We hope this helps to address some of this RFE
https://2e4ccba981d63ef83a875dad7396c9a0.ideas.aha.io/ideas/R-I-400 and improve the script developer experience. Again this is only available in Python 3 scripts in v42. The log output will always be filtered by the logging level of the scripting server so by default debug level statements will be excluded.
Thanks,
------------------------------
Sean Mc Cann
------------------------------