Page History
Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Introduction
The JITL Check Log Job CheckLogJob template can be used to check the log output of an a previously executed job in the workflow.
...
- Analysis includes to identify warnings and errors.
- Analysis includes to identify output for decision-making about next steps in a workflow.
The job template makes use of the JS7 - REST Web Service API to run reports from the JOC Cockpit.:
- The job template authenticates with the JS7 - REST Web Service API with a user account/password and/or with a certificate, for details see JS7 - Authentication.
- For details about configuration items see JS7 - JITL Common Authentication.
...
- specify the
JITL
job class andcom.sos.jitl.jobs.checklog.CheckLogJob
Java class name.
Example
...
Download (upload .json) The workflow configuration can be downloaded from here: js7_checklog.workflow.json
This example sample workflow includes 3 the following jobs:
create-log
: creates log output.check-log
: analyzes log output of the previous job.display-result
: displays the outcome of log analysis.- job1: Just producing a log.
- job2: Analysing the log
- job_result: Showing the outcome of job_checklog
To create the job job_checklog
you can use check-log
job, users can invoke the job wizzard like this.
...
When hitting the Submit button the wizard adds the required arguments to the job which should look like this:
Documentation
The Job Documentation including the full list of arguments can be found from: https://www.sos-berlin.com/doc/JS7-JITL/CheckLogJob.xml
Arguments
The CheckLogJob EncryptJob class accepts the following arguments:
Name | Required | Description | Default |
---|---|---|---|
|
yes | Job |
in the current workflow |
for which log output should be analyzed If the job occurs more than |
once in the workflow, the |
|
argument must be specified. | |
label |
no | Label |
of the job |
for which log output should be analyzed If the job occurs more than |
once in the workflow, the |
|
argument must be specified to identify the unique |
occurrence of the job |
.. | |
pattern |
The regular expression to be
yes | Regular expression used to |
analyze the log The regular expression is applied to log output of the |
job. Exampe 1: |
Identify lines with errors Arguments:
|
Return Variables:
Example 2: |
Identify Event IDs Arguments:
|
Return Variables:
Example 3: |
Identify dates Arguments:
|
|
Return Variables:
|
|
|
|
|
|
|
|
Arguments:
|
|
Return Variables:
|
|
|
separator |
separator
no | Separator for matches |
Executing the regular expression on |
log output can result in several matches |
that are returned |
from the |
js7CheckLogMatches or js7CheckLogMatchedGroups |
variables. Matches are separated from each other |
by the separator character. By default the pipe character | is used. | | | |
timeout | no | Maximum duration to |
read task history When the |
CheckLogJob job is executed, the |
JOC Cockpit History may not yet |
have been added related results of the job execution to be analyzed. Repeated calls are |
performed with a delay |
of 3s |
until a call is successful or the maximum |
duration specified for the timeout is reached whichever occurs first. | 15 | |
multiline | no | Handling |
log output as one line or as multiple lines Enables multiline mode |
in which the expressions ^ and $ |
match just after or |
before, respectively, a line terminator or the end of the input sequence. By default |
the expressions |
match |
the beginning and the end of the entire input sequence. Multiline mode can |
be enabled |
by the embedded |
flag expression (?m) too. | false | |
case_insensitive | no | Handling of |
uppercase/lowercase Enables case-insensitive matching. By default, case-insensitive matching assumes that only characters in the US-ASCII charset are being matched. Unicode-aware case-insensitive matching can be enabled by specifying the UNICODE_CASE flag in |
combination with this flag. Case-insensitive matching can |
be enabled via the embedded flag expression (?i) too. Specifying |
the flag may impose |
slight performance |
penalties. |
| |
unix_lines | no | Handling of line mode This flag enables Unix |
line mode in which '\n' is used as a line terminator and ‘\r’ is treated as a literal character. |
|
Return Values
The returncode return code of the job is 0 when if the pattern matches . Otherwise it and otherwise is 1.
Name | Description |
---|---|
js7CheckLogMatchedGroups | Matching groups separated by the separator signGroups A string value holding the matching groups of the task log. An empty value is returned if the pattern doesn't not match. In case of a pattern specifying capturing groups, the matching characters are provided for each group. The return variable holds values per group separated by the character specified from the |
js7CheckLogMatches | Matches separated by the separator sign A string value holding the matching characters of the task log. An empty value is returned if the pattern doesn't not match The return variable holds values per match separated by the character specified from the |
js7CheckLogMatchCount | Count of matchesMatches The count number of matches from the task log. |
js7CheckLogGroupsMatchesCount | Count of matchesmatched Groups The count number of matched groups . Depends that depends on the value for the parameter "multiline". multiline=false -- matched groups when the log is regarded as one line. multiline=true -- Sum
|
js7CheckLogGroupCount | Count of groupsGroups The number of groups in the pattern. |
...
Resources
- JS7 - JITL Common Variables
- JS7 - How to make a global Business Date variable available to jobsJS7 - How to update a Job Resource using Unix ShellJITL Common Authentication