This article shows, how to read the log from a job and to search for a specific string. The next step depends on finding the string in the log file.

In the example you find a job chain named job_chain_example_search_text. This job chain has 2 steps.

  • execute myJob
  • examine the task log of myJob. If the string "looking for text example" exists in the job output to stdout then the processing is moved to the success state, otherwise to the error state.

This is the job myJob. As you can see it produces the output job_chain_example_search_text:
 

 

This is the job chain with the two steps:
 

 

The second step has the parameters for the search: 

 

In the post-processing of the second step you see the code for switching to error or to success:
 

You can download the example from here: download Example