1 Reply Latest reply on Sep 30, 2015 12:57 PM by Bill Robinson

    capture error string in job log

    James Donohue



      My question is: I'm executing a scheduled NSH Job and one of the lines in the job is as follows:

      grep $entry //${server}/$spath && EXPORTS_VERSION="12" || EXPORTS_VERSION="Invalid"


      Some of the Servers have Agent issues(which is a separate effort than this) and the GREP line is echoing the following to the log for some Servers:

      Error    Sep 30, 2015 1:41:51 PM    //Server1/c/Windows/rsc/EXPORTS: Connection refused

      Error    Sep 30, 2015 1:42:35 PM    //Server2/c/Windows/rsc/EXPORTS: Connection timed out

      I want to find a way to capture the text in BOLD above and write it to my CSV file with all other entries that I'm writing. I tried capturing it a variable and also tried "$?" which captures the result code but the code is always th same for both errors. How is the job capturing the different errors but the result code the same?


      Objective: Get the Error "text strings" into my csv file?