system-streams
Retrieves the list and status of stream queries registered in the system.
Command properties
| Property | Description |
|---|---|
| Command type | Driver query |
| Required permission | Cluster administrator |
| License usage | Not counted |
| Parallel execution | Not supported |
| Distributed execution | Not supported |
Syntax
Output fields
| Field | Type | Description |
|---|---|---|
| source_type | string | Data source type. One of logger, table, or stream |
| name | string | Stream query name |
| running | boolean | Whether running (true: running, false: stopped) |
| enabled | boolean | Whether enabled (true: enabled, false: disabled) |
| async | boolean | Whether in asynchronous mode (true: async, false: sync) |
| error_code | string | Last error code. Returns null if there is no error. |
| error_msg | string | Last error message. Returns null if there is no error. |
| description | string | Description of the stream query |
| interval | integer | Refresh interval (unit: seconds). 0 means unlimited; only streamable commands can be used. |
| query_string | string | Query string |
| input_count | long | Number of input records |
| output_count | long | Number of output records |
| last_input_at | timestamp | Most recent input time. Returns null if there has been no input. |
| last_output_at | timestamp | Most recent output time. Returns null if there has been no output. |
| owner | string | Name of the account that created the stream query |
| created_at | timestamp | Creation timestamp |
| modified_at | timestamp | Last modification timestamp |
| last_refresh_at | timestamp | Most recent refresh time |
| last_count | long | Number of records processed during the last execution |
| last_time | long | Elapsed time of the last execution (unit: nanoseconds) |
| total_count | long | Cumulative number of records processed |
| total_time | long | Cumulative elapsed time (unit: nanoseconds) |
| max_count | long | Maximum number of records processed in a single execution |
| max_time | long | Maximum elapsed time in a single execution (unit: nanoseconds) |
| input_tables | array | List of input table names |
| input_loggers | array | List of input collector names |
| input_streams | array | List of input stream query names |
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 95020 | no-read-permission | The command was run by an account without cluster administrator permission |
Runtime errors
N/A
Description
The system-streams command retrieves the list and status of stream queries registered in the system. You can check the name, running status, input/output record counts, and performance counters for each stream query.
Cluster administrator permission is required to run this command. Running it without administrator permission causes error code 95020.
The source_type field indicates the data source type of the stream query. logger means a collector, table means a table, and stream means another stream query is used as the data source.
Performance counter fields (last_count, last_time, total_count, total_time, max_count, max_time) only return values when performance statistics have been collected for the stream query.
Examples
-
Retrieve all stream queries
system-streamsRetrieves the status and configuration of all stream queries registered in the system.
-
Retrieve only running stream queries
system-streams | search running == trueFilters and retrieves only stream queries that are currently running.
-
Count stream queries by data source type
system-streams | stats count by source_typeCounts the number of stream queries by data source type.
-
Retrieve stream queries with errors
system-streams | search isnotnull(error_code)Filters and retrieves only stream queries that have errors, to check error codes and messages.