sentry-logger-start

Starts a logger on a remote sentry.

Command properties

PropertyDescription
Command typeTransforming
Required permissionAdministrator
License usageN/A
Parallel executionSupported
Distributed executionNot supported

Syntax

sentry-logger-start [timeout=INT]

Options

timeout=INT
RPC timeout in seconds. Accepts a value between 1 and 600. (Default: 30)

Input fields

FieldTypeRequiredDescription
guidstringRequiredSentry unique identifier.
namestringRequiredLogger name that is unique within the sentry namespace.
intervalintegerRequiredCollection interval in milliseconds.

Output fields

FieldTypeDescription
_errorstringError message added to the original record if an error occurs. This field is absent when processing succeeds.

Possible values for the _error field:

Error messageDescription
guid is nullThe guid field value in the input record is null.
guid should be stringThe guid field value in the input record is not a string.
guid should be non empty stringThe guid field value in the input record is an empty string.
name should be not nullThe name field value in the input record is null.
name should be stringThe name field value in the input record is not a string.
name should be non empty stringThe name field value in the input record is an empty string.
interval should be not nullThe interval field value in the input record is null.
interval should be integerThe interval field value in the input record is not an integer.
not connectedThe specified sentry is not connected.
timeoutThe RPC request timed out.
disconnectedThe connection was lost while processing the RPC request.

Other RPC error messages may be assigned depending on the sentry environment.

Error codes

Parsing errors
Error codeMessageDescription
23100No permission to call sentry RPC.The command was run from a session without administrator privileges.
23101Invalid sentry RPC timeout option value. Use a value between 1 and 600.The timeout option value is not an integer or is outside the range 1–600.
Runtime errors

N/A

Description

The sentry-logger-start command uses the guid, name, and interval fields of the input record to send an asynchronous RPC request that starts a logger on the remote sentry. Once started, the logger collects logs at the specified interval in milliseconds.

The maximum size of the asynchronous RPC request queue is 100 by default and can be changed using the logpresso.core.sentry_rpc_parallel system property. When the queue is full, new requests wait until existing requests complete or time out.

Results are output in the order RPC responses are received, so the output record order may differ from the input record order.

Examples

  1. Start all loggers with a 5-second interval

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

    Starts all loggers on all sentries with a 5-second (5,000 ms) collection interval.

  2. Start a specific logger with a 10-second interval

    sentry
    | sentry-loggers
    | search name == "syslog"
    | eval interval = 10000
    | fields guid, name, interval
    | sentry-logger-start timeout=60
    

    Starts the syslog logger on all sentries with a 10-second (10,000 ms) collection interval. The RPC timeout is set to 60 seconds.