Accessing log files

The dsjob command can be used to add entries to a job's log file, or retrieve and display specific log entries.

The different versions of the syntax are described in the following sections.

Adding a log entry

The following syntax adds an entry to the specified log file. The text for the entry is taken from standard input to the terminal, ending with Ctrl-D.


dsjob -log [ -info | -warn ] [ -useid ] project job|job_id

-info specifies an information message. This is the default if no log entry type is specified.

-warn specifies a warning message.

-useid specify this if you intend to use a job alias (jobid) rather than a job name (job) to identify the job.

project is the name of the project containing job.

job is the name of the job that the log entry refers to. To identify a job invocation, use the format job.invocation_id.

job_id is an alias for the job that has been set using the dsjob -jobid command.

This syntax is equivalent to the DSLogEvent function.

Displaying a short log entry

The following syntax displays a summary of entries in a job log file:


dsjob -logsum [-type type] [ -max n ] [ -useid ] project job|job_id

-type type specifies the type of log entry to retrieve. If -type type is not specified, all the entries are retrieved. type can be one of the following options:

This option...
Retrieves this type of log entry...
INFO
Information.
WARNING
Warning.
FATAL
Fatal error.
REJECT
Rejected rows from a Transformer stage.
STARTED
All control logs.
RESET
Job reset.
BATCH
Batch control.
ANY
All entries of any type. This is the default if type is not specified.

-max n limits the number of entries retrieved to n.

-useid specify this if you intend to use a job alias (jobid) rather than a job name (job) to identify the job.

project is the project containing job.

job is the job whose log entries are to be retrieved. To identify a job invocation, use the format job.invocation_id.

job_id is an alias for the job that has been set using the dsjob -jobid command.

Displaying a specific log entry

The following syntax displays the specified entry in a job log file:


dsjob -logdetail [-full] [-useid] project job|job_id entry

-full specify this if you want the message ID and the invocation ID fields to be displayed.

-useid specify this if you intend to use a job alias (jobid) rather than a job name (job) to identify the job.

project is the project containing job.

job is the job whose log entries are to be retrieved. To identify a job invocation, use the format job.invocation_id.

job_id is an alias for the job that has been set using the dsjob -jobid command.

entry is the event number assigned to the entry. The first entry in the file is 0.

This syntax is equivalent to the DSGetLogEntry function, or the DSGetLogEntryFull function if -full is specified.

Identifying the newest entry

The following syntax displays the ID of the newest log entry of the specified type:


dsjob -lognewest [ -useid ] project job|job_id type

-useid specify this if you intend to use a job alias (jobid) rather than a job name (job) to identify the job.

project is the project containing job.

job is the job whose log entries are to be retrieved. To identify a job invocation, use the format job.invocation_id.

job_id is an alias for the job that has been set using the dsjob -jobid command.

type can be one of the following options:

This option...
Retrieves this type of log entry...
INFO
Information
WARNING
Warning
FATAL
Fatal error
REJECT
Rejected rows from a Transformer stage
STARTED
Job started
RESET
Job reset
BATCH
Batch

This syntax is equivalent to the DSGetNewestLogId function.