Custom Exit Codes and Regular Expression Pattern Matching against Logs


JAMS can recognize a custom set of exit code values or regular expression patterns in the output of a job, and this pattern matching feature can be used to return success or error for that job.

In the properties of an Execution Method, go to the completion tab as shown below.

Under Exit Code Handling pull down, users will have a few options with regards to which exit codes to use.  A user can then fill in the appropriate values separated by commas if users have multiple custom code values.


For regular expression patterns users want to make sure that "MessageCode" is selected from the pull down menu. Standard Microsoft .NET regular expression language can be used here, including * (for wildcards) and pipe | to delimit each string.

Have more questions? Submit a request


  • Avatar
    Jared Stroebele

    For MessageCode exit handling if only the success string is specified will a failure to find the success string result in a status code of failure?

    Edited by Jared Stroebele
  • Avatar
    Jared Stroebele

    For MessageCode exit handling if the Success string and the Failure string are both found by Regex what is the resulting Status Code? In my case I am running the same executable three times with different parameters in the same Job. I might get two success messages in the log and one failure.

  • Avatar
    Gennaro Piccolo

    Hello Jared,

    If only a success string is specified and none are found, it will be considered a warning.

    If both success and failure strings are specified and both are found it is considered a failure.

    There are two job parameters that can be defined in JAMS V6.x to modify regular expression matching results. Both are Boolean parameters and are false if undefined.

    JAMSGoodMatchOverridesStatus – When set to true, if the exit status is “bad” but, there are matches of the good pattern, the completion severity is set to Informational.

    JAMSNoMatchIsSuccess – When set to true, if there is a good pattern and there were no matches, the completion severity is set to Success.