sentry-logger-set-interval

Changes the collection interval of a remote sentry logger.

Command properties

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

Syntax

sentry-logger-set-interval [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.
intervalintegerRequiredCollection interval in milliseconds.

Output fields

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.
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 returned depending on the state of the system where the sentry is installed.

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 outside the range 1–600 or is not a number.
Runtime errors

N/A

Description

The sentry-logger-set-interval command identifies a sentry by the guid field of the input record and a logger by the name field, then changes the collection interval to the millisecond value specified in the interval field by sending an asynchronous RPC message to the sentry.

The maximum length of the asynchronous RPC request queue is 100 by default and can be adjusted using the logpresso.core.sentry_rpc_parallel environment variable. 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 from sentries, so the output record order may differ from the input record order.

Examples

  1. Change the collection interval of a specific logger on all sentries to 5 seconds

    system sentries
    | sentry-loggers
    | search name == "wtmp_linux"
    | eval interval = 5000
    | sentry-logger-set-interval
    

    Changes the collection interval of the wtmp_linux logger to 5,000 milliseconds (5 seconds) on all connected sentries.

  2. Change the collection interval with a specified timeout

    system sentries
    | sentry-loggers
    | search name == "syslog_linux"
    | eval interval = 10000
    | sentry-logger-set-interval timeout=60
    

    Changes the collection interval of the syslog_linux logger to 10,000 milliseconds (10 seconds) with the RPC timeout set to 60 seconds.