sentry-loggers

Retrieves the logger list from a remote sentry.

Command properties

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

Syntax

sentry-loggers [timeout=INT]

Options

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

Input fields

FieldTypeRequiredDescription
guidstringRequiredSentry unique identifier.

Output fields

FieldTypeDescription
guidstringSentry unique identifier.
namestringLogger name.
descriptionstringLogger description.
factory_namestringLogger type identifier.
statusstringLogger status: running or stopped.
intervalintegerCollection interval (unit: milliseconds).
cron_schedulestringCron-format collection schedule.
transformerstringTransformer identifier.
stop_reasonstringReason the logger stopped.
log_countlongNumber of records collected.
drop_countlongNumber of records dropped.
log_volumelongVolume of data collected (unit: bytes).
drop_volumelongVolume of data dropped (unit: bytes).
last_start_attimestampMost recent time the logger was activated.
last_run_attimestampMost recent time collection was executed.
last_log_attimestampTime of the most recently collected log.
last_write_attimestampMost recent system time a log was written.
start_timestringCollection start time (format: HH:mm).
end_timestringCollection end time (format: HH:mm).
failurestringLogger stop reason recorded during collection.
configsobjectLogger configuration.

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

N/A

Description

The sentry-loggers command sends asynchronous RPC requests to remote sentries identified by the guid field of each input record to retrieve the logger list. If the sentry version is 3.8.0 or later, the getLoggers2 RPC method is called; otherwise, getLoggers is called.

The size of the asynchronous RPC request queue can be adjusted using the logpresso.core.sentry_rpc_parallel system property; the default is 100. When the queue is full, new requests are held 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.

If the guid field of an input record is null, is not a string, is an empty string, or the corresponding sentry is not connected, the _error field is assigned an error message and the original record is output unchanged. If an RPC timeout occurs, timeout is assigned to the _error field.

To retrieve results from all Data Nodes at once in a cluster environment, use the sonar-sentry-loggers command.

Examples

  1. Retrieve the logger list from all sentries

    system sentries | fields guid | sentry-loggers
    

    Sends RPC requests to all connected sentries to retrieve the logger list.

  2. Retrieve with a 60-second timeout

    system sentries | fields guid | sentry-loggers timeout=60
    

    Retrieves the logger list with the timeout extended to 60 seconds for high-latency environments.