sentry-logger-start

Activates a specific logger of a sentry to run at the specified interval.

Syntax

sentry-logger-start [timeout=INT]
Parameter
timeout=INT
RPC timeout in seconds (default: 30 seconds)

Description

This command receives a sentry identifier field (guid) value, a logger name field (name) value and a logging interval field (interval) value from an input record and then sends an asynchronous RPC message to the sentry to activate the logger to run every specified interval.

Logpresso environment variable logpresso.core.sentry_rpc_parallel determines the length of the asynchronous RPC request message queue. The default value is 100 and you can adjust the length by modifying this environment variable.

The RPC request message queue operates on a first-in, first-out (FIFO) basis. For example, if the Logpresso server needs to send an RPC message to 150 sentries, the server first sends RPC messages to 100 sentries and waits until RPC responds. If the waiting time exceeds the time specified in the timeout (default: 30 seconds), it is considered that an error has occurred on the sentry side. If 32 out of 100 sentries have responded or timeout has been exceeded, the Logpresso server sends an RPC message to the additional 32 sentries.

This command outputs results in the order that the server received the sentry's RPC response message, which means the order of the output records may differ from the order of the input records. Use the output data but do not rely on the order of the records.

Input Field

This query requires that the input record contains guid, name and interval field values.

FieldTypeDescription
guidStringUnique sentry identifier (Not relevant to GUID in JAVA)
nameStringUnique logger identifier in the sentry namespace
interval32-bit IntegerLogging interval (Unit: millisecond)
Output Fields

If any error occurs, this query command returns an _error field in addition to the fields from input record. Possible errors are as follows:

Error MessageDescription
guid is nullguid field value from input record is null.
guid should be stringguid field value from input record is not a string.
guid should be non empty stringguid field value from input record is empty.
name should be not nullname field value from input record is null.
name should be stringname field value from input record is not a string.
name should be non empty stringname field value from input record is empty.
interval should be not nullinterval field value from input record is null.
interval should be integerinterval field value from input record is not an integer.
logger is already runningLogger is already running.
timeoutRPC request timeout exceeded.
disconnectedDisconnected while processing RPC request.
not connectedSentry is not connected.

Depending on the system where the sentry is installed, an RPC exception message other than the above can be issued.

Usage

  1. Activate loggers of all sentries to run every 5 seconds.

    sentry
    | sentry-loggers
    | eval interval = 5000
    | fields guid, name, interval
    | sentry-logger-start