Page 1 of 1

How to capture the message from Director Log?

Posted: Thu Dec 16, 2004 4:02 am
by Nripendra Chand
In event detail section of Log info i can see the appropriate message. how can i capture this message on server jobs? I want to capture only the message.

-Nripendra

Posted: Thu Dec 16, 2004 7:37 am
by vinodlakshmanan
If you want to do it using Unix, you can do it using the dsjob command. You will need the log ID for this. You can get this using the -logsum or -lognewest option. Using the log ID, you can get the message using the -logdetail option.

Posted: Thu Dec 16, 2004 7:43 am
by chulett
Perhaps the "FAQ Man" should put together one on this topic. :wink: It sure seems to be a popular topic lately!

Posted: Thu Dec 16, 2004 8:13 am
by kduke
I still do not get why people are doing all this in a routine. Write a job. Start with a UV stage. Output to a sequential file or a target table. I prefer the later. Here is the SQL for the UV stage.

Code: Select all

select EVAL "'#JobName#'" AS JOB_NAME, TIMESTAMP, SEVERITY, FULL.TEXT from RT_LOG#JobNo# where EVAL "@ID" NOT LIKE '//%' order by TIMESTAMP;

I really think a lot of this is easier in jobs. All you need to do is write a batch job to feed the job names and job numbers into the parameters for JobName and JobNo. Just a few lines of code. You will need to create the target table.

Posted: Thu Dec 16, 2004 8:14 am
by kduke
The key to the target table is JobName and TIMESTAMP. I do row counts this way.

I would skip multiple instance jobs unless you know the InvocationId. InvocationId is stored in field 7 of the log. Your SQL will change too.