Variable with Job Log Path

Path to the log of the currently running Uproc can be used as a variable.

Description

This is a script (or code) that can be used placed into U_ANTE_UPROC so that the path to the log of the currently running Uproc can be used as a variable.

The variable will show the path to the log which will show activity in the Uporc up to the point it is called. This can be used for a variety of processes such as regular expression searches in the log.

Example

Code below to be added to a Test Uproc do demonstrate the use of the new variable

Unix:

echo "This is a test uproc message - line 1"
echo "This is a test uproc message - line 2 - hello"
echo "This is a test uproc message - line 3"
echo ""
echo "My log is set to $UNI_MYLOG"
echo ""
echo "#### Searching for lines in the log containing the word \"hello\" ###"
echo ""
echo "#####################################"
echo ""

grep "hello" $UNI_MYLOG

exit $?


Windows:

echo "This is a test uproc message - line 1"
echo "This is a test uproc message - line 2 - hello"
echo "This is a test uproc message - line 3"
echo.
echo My log is %UNI_MYLOG%
echo.
echo "#### Searching for lines in the log containing the word "hello" ###"
echo.
findstr "hello" %UNI_MYLOG%


In the example Test Uproc echos 3 lines then carries out a 'grep' to look for lines in the log that contain the word 'hello'.

In this case it finds 2 lines, the echo in the initial 3 lines and then the echo in the information line, saying that the Uproc is searching for the word hello.

(Obviously more complex processes can be developed)

 

Target environments: Unix Linux, Windows

Prerequisites: A U_ANTE_UPROC must exist in the UXMGR directory

Implementation: Add the code to an existing U_ANTE_UPROC or put the file into the UXMGR directory as U_ANTE_UPROC


Operating Systems


Versions

This plugin has no official releases yet

Created by....

A member of the Automic Community


Login to View or Leave Comments