Action Output Monitors allow you to automatically scan an action's output for certain content, and perform various actions if that content is found. For example, you can have an action fail if text like "warning" is found - even though normally that action would succeed.
Only output created while the action is running is monitored - output from the BeforeAction and AfterAction script events is not monitored.
To edit Action Output Monitors, go to the Runtime property page and click on the ellipsis (...) edit button for Output Monitors.
This is the string to search for in the action output. In the example above, the monitor will match any line that contains the string "Warning :".
Matches cannot be made over multiple lines of output. If you need to match across multiple lines, it is recommended that you log the action output to a variable and use the Text Find/Replace action.
If this box is checked, output matching will be case sensitive.
If this box is checked, the search string can contain the wildcard characters "*" and "?". * will match any number of characters (including none), whereas ? will match any single character.
If this box is checked, the search string must match a whole word - not part of a word.
If this box is checked, the search string is treated as a regular expression. This checkbox cannot be used along with "Use Wildcards" or "Whole Words Only".
The Behaviour dropdown menu allows you to choose what happens if this monitor matches some output from the action.
If the search string is matched then the action will always fail, regardless of the action result status. Any matched lines will be highlighted as "Error" output.(*)
The action will always fail (regardless of result status), unless at least one match for the search string is found.(*)
If the search string is matched then the action will always succeed, regardless of the action result status. Any matched lines will be highlighted as "Success" output.(*)
The action will always succeed (regardless of result status), unless at least one match for the search string is found.(*)
Any line of output which matches will be suppressed from the action's log output.
Any line of output which does not match the search text will be suppress from the actions log output.
Any line of output which matches will cause the action to terminate and return a failure result.
(For these behaviours, a dropdown appears allowing you to choose a variable name.)
The line which matches the search string will be written to a variable when the action completes. In the case of multiple matches, "First Match" means that only the first match will be written, "Last Match" means only the last match.
(For this behaviour, a dropdown appears allowing you to choose a variable name.)
Any string which matches the search string will be written to a variable. In the case of multiple matches, each match will be written on a new line. If there are no matches, the variable will be set to an empty string.
(For this behaviour, a dropdown appears allowing you to choose a variable name.)
* Using multiple monitors with fail/succeed
If there are multiple monitors which force the action to both fail and succeed, and both find matches in the action is output, then the monitors are applied in the order they are shown in the dialog box, ie if a "Succeed" monitor is triggered followed by a "Fail" monitor, the action will fail. The action log output will show the status of both monitors, in order.
The AfterAction script event has the opportunity to futher modify the action result.
Monitors are applied live
Monitoring is applied to the output immediately as it is received from the action, before the OnStatusMessage script event. However, results (like setting variables) are not applied until the action finishes running. If you use variable references in the search string, be aware that the variable values may change as the action runs.