sentry-loggers
Retrieves the logger list from a remote sentry.
Command properties
| Property | Description |
|---|---|
| Command type | Transforming |
| Required permission | Administrator |
| License usage | N/A |
| Parallel execution | Supported |
| Distributed execution | Not supported |
Syntax
Options
timeout=INT- RPC timeout in seconds. Accepts a value between 1 and 600. (Default:
30)
Input fields
| Field | Type | Required | Description |
|---|---|---|---|
| guid | string | Required | Sentry unique identifier. |
Output fields
| Field | Type | Description |
|---|---|---|
| guid | string | Sentry unique identifier. |
| name | string | Logger name. |
| description | string | Logger description. |
| factory_name | string | Logger type identifier. |
| status | string | Logger status: running or stopped. |
| interval | integer | Collection interval (unit: milliseconds). |
| cron_schedule | string | Cron-format collection schedule. |
| transformer | string | Transformer identifier. |
| stop_reason | string | Reason the logger stopped. |
| log_count | long | Number of records collected. |
| drop_count | long | Number of records dropped. |
| log_volume | long | Volume of data collected (unit: bytes). |
| drop_volume | long | Volume of data dropped (unit: bytes). |
| last_start_at | timestamp | Most recent time the logger was activated. |
| last_run_at | timestamp | Most recent time collection was executed. |
| last_log_at | timestamp | Time of the most recently collected log. |
| last_write_at | timestamp | Most recent system time a log was written. |
| start_time | string | Collection start time (format: HH:mm). |
| end_time | string | Collection end time (format: HH:mm). |
| failure | string | Logger stop reason recorded during collection. |
| configs | object | Logger configuration. |
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 23100 | No permission to call sentry RPC. | The command was run from a session without administrator privileges. |
| 23101 | Invalid 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
-
Retrieve the logger list from all sentries
system sentries | fields guid | sentry-loggersSends RPC requests to all connected sentries to retrieve the logger list.
-
Retrieve with a 60-second timeout
system sentries | fields guid | sentry-loggers timeout=60Retrieves the logger list with the timeout extended to 60 seconds for high-latency environments.