sentry-logger-connect

Configures a remote sentry logger to receive logs.

Command properties

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

Syntax

sentry-logger-connect [timeout=INT]

Options

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

Input fields

FieldTypeRequiredDescription
guidstringRequiredSentry unique identifier.
namestringRequiredName of the logger to configure for log reception.

Output fields

All fields of the input record are preserved. If an error occurs, the following field is added:

FieldTypeDescription
_errorstringError message added to the original record if an error occurs.

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.
not connectedThe specified sentry is not connected.
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.
timeoutThe RPC response did not arrive within the timeout period.
disconnectedThe sentry connection was lost during the RPC call.

Error codes

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

N/A

Description

The sentry-logger-connect command identifies a sentry by the guid field of the input record and configures the logger specified by the name field to receive logs using the remote RPC call connectRemoteLogger.

If the input field values are invalid or the sentry is not connected, the _error field is added to the original record. If the RPC response does not arrive within the timeout period, _error: timeout is set on the record.

Up to 100 RPC requests are processed concurrently. The concurrency limit can be changed using the logpresso.core.sentry_rpc_parallel system property.

Examples

  1. Configure logger log reception

    system sentries
    | eval name = "local\\\\syslog"
    | sentry-logger-connect
    | search isnull(_error)
    | fields guid, name
    

    Configures the local\syslog logger on all sentries for log reception and outputs only records that were processed without errors.

  2. Configure logger log reception with a specified timeout

    system sentries
    | eval name = "local\\\\syslog"
    | sentry-logger-connect timeout=60
    | fields guid, name, _error
    

    Configures logger log reception with the RPC timeout set to 60 seconds and outputs the processing results.