EMS Manual

Retrieving Event Messages Programmatically
EMS Manual426909-005
4-10
Log File Position
! Check if anything wrong with response buffer
IF spi^error <> ZSPI^ERR^OK THEN ...
! Buffer ok. Was distributor CONTROL command ok?
spi^error := SSGETTKN(spibuffer,
ZSPI^TKN^RETCODE,
error,
1);
! Handle any error from SPI procedure
IF spi^error <> ZSPI^ERR^OK THEN ...
IF error <> 0 THEN ... ! Handle error
! Distributor now uses log file source
Log File Position
You can use either of two time tokens in the CONTROL command message to specify
where in the collector log or the saved log file you want the distributor to start retrieving
event messages:
To position the distributor by event-message generation time, use the token
ZEMS^TKN^GMTTIME.
To position the distributor by event-message log time, use the token
ZEMS^TKN^LOGTIME.
Both parameters require that you specify the time as Greenwich mean time (GMT).
If you do not specify GMTTIME or LOGTIME before the distributor starts examining
messages, the distributor uses these positioning specifications:
If the event-message source is the current log file of one or more collectors, the
distributor retrieves incoming event messages as they are logged by the collector
(or collectors), starting at the time the CONTROL command message is
processed.
If the event-message source is a saved log file, the distributor retrieves event
messages starting at the beginning of the log file.
This example positions the distributor so that it returns all event messages generated
at or after 7:30 a.m. Local Civil Time:
! Compute time to use as token value
time^array[0] := 1996; !year
time^array[1] := 3; !month
time^array[2] := 21; !day of the month
time^array[3] := 7; !hour
time^array[4] := 30; !minute
time^array[5] := 0; !second
time^array[6] := 0; !millisecond
time^array[7] := 0; !microsecond
local^time := COMPUTETIMESTAMP(time^array);