Page 1 of 1

Latest logdetails using RT_LOG file

Posted: Fri Dec 23, 2011 1:30 am
by kamesh
Hi,

I can easily extract the latest run log of a multi instance job for a given invocation using dsjob CLI command but it takes forever when there is too much log and instances.

dsjob -logdetail <Project> <Job>.<InvocationID>

I tried below command but it returns two log runs info including latest and have same WAVE.NO, but I need only latest run log info. So, what field holds latest run tag for a given invocation in RT_LOG?

$DSHOME/bin/dssh "SELECT @ID FMT '20L',TIMESTAMP FMT '20L',EVAL \"IF @RECORD<7> MATCHES '' THEN 'NULL' ELSE @RECORD<7>\" FMT '100L' AS INVOCATION, FULL.TEXT FMT '260L', WAVE.NO FMT '20L' FROM RT_LOG87 WHERE CAST(@ID AS VARCHAR) NOT LIKE '/%' and INVOCATION=<INV ID> and WAVE.NO=(SELECT MAX(WAVE.NO) FROM RT_LOG87 WHERE INVOCATION=<INV ID>) ORDER BY @ID SUPPRESS COLUMN HEADING COUNT.SUP COL.SPCS;"

Thanks in advance!

Re: Latest logdetails using RT_LOG file

Posted: Thu Dec 29, 2011 1:15 am
by kamesh
I think everyone is on vacation but appreciate if anyone has any clue of my requirement below.

Posted: Mon Jan 02, 2012 10:26 am
by kduke
You need to get the last ID using dsjob -loginfo. This needs to be added to your SELECT WHERE clause.

Posted: Wed Jan 04, 2012 4:49 am
by kamesh
Thank you Duke!

I think you mean dsjob -lognewest or dsjob -logsum but this should be run before we start the job and should be used after job is completed in the where clause to get the latest log details.

This would be a two step process. Don't we have any flag within the RT_LOG which keeps track of latest run for a given invocation?

Posted: Wed Jan 04, 2012 2:46 pm
by ray.wurlod
There is no flag. You could, of course, determine the most recent "job started" event by constraining on max of TIMESTAMP and event type.