sentry-logger-set-time-range
Sets the allowed operating time range for a remote sentry logger.
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. |
| name | string | Required | Logger name. |
| start_time | string | Optional | Collection start time (format: HH:mm). Must be specified together with end_time. |
| end_time | string | Optional | Collection end time (format: HH:mm). Must be specified together with start_time. |
Output fields
| Field | Type | Description |
|---|---|---|
| _error | string | Error message added to the original record if an error occurs. |
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 23100 | No permission to call sentry RPC. | A user without administrator privileges ran the command. |
| 23101 | Invalid 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
Errors are returned via the _error field:
| Error message | Description |
|---|---|
| guid is null | The guid field value in the input record is null. |
| guid should be string | The guid field value in the input record is not a string. |
| guid should be non empty string | The guid field value in the input record is an empty string. |
| name should be not null | The name field value in the input record is null. |
| name should be string | The name field value in the input record is not a string. |
| name should be non empty string | The name field value in the input record is an empty string. |
| invalid start_time format | The start_time field value is not a valid HH:mm format. |
| invalid end_time format | The end_time field value is not a valid HH:mm format. |
| start_time is not null but end_time is null | start_time is specified but end_time is null. |
| end_time is not null but start_time is null | end_time is specified but start_time is null. |
| not connected | The sentry is not connected. |
| timeout | The RPC request timed out. |
| disconnected | The connection was lost while processing the RPC request. |
Other RPC exception messages may be returned depending on the state of the system where the sentry is installed.
Description
The sentry-logger-set-time-range command reads the guid, name, start_time, and end_time fields from input records and sets the allowed operating time range for the corresponding sentry logger by sending an asynchronous RPC message.
If both start_time and end_time field values are null, the existing allowed time range setting for the target logger is removed. If only one is null and the other is not, an error occurs.
Time values must be 5-character strings in HH:mm format. The hour must be in the range 0–24 and the minute must be in the range 0–60.
This command returns results in the order RPC response messages are received from sentries, so the output record order may differ from the input record order.
Examples
-
Set the allowed operating time range for a specific logger
sentry | sentry-loggers | search name == "weblog" | eval start_time = "22:00", end_time = "06:00" | sentry-logger-set-time-rangeConfigures the
webloglogger on all sentries to collect only between 10:00 PM and 6:00 AM. -
Remove the allowed time range setting
sentry | sentry-loggers | search name == "weblog" | eval start_time = null, end_time = null | sentry-logger-set-time-rangeRemoves the allowed time range setting for the
webloglogger on all sentries so that it always collects.