system-scheduled-queries

Retrieves the configuration and execution status of scheduled queries registered in the system.

Command properties

PropertyDescription
Command typeDriver query
Required permissionCluster administrator
License usageNot counted
Parallel executionNot supported
Distributed executionNot supported

Syntax

system-scheduled-queries

Output fields

FieldTypeDescription
typestringItem type. Always query
guidstringUnique identifier (UUID) of the scheduled query
namestringScheduled query name
schedulestringCron expression representing the execution schedule
runningbooleanWhether currently running. true if running
enabledbooleanWhether enabled. true if enabled
bootstrapbooleanWhether this is a bootstrap query. true if it runs once automatically at server startup
bootstrap_timetimestampTime the bootstrap query completed. Null if bootstrap is false
bootstrap_errorstringError message if the bootstrap query failed. Null if successful or if bootstrap is false
save_resultbooleanWhether the execution result is saved. true if saved
ownerstringName of the account that created the scheduled query
descriptionstringScheduled query description
query_stringstringQuery string to execute
alert_querystringAlert condition query string. Null if not configured
suppress_intervallongAlert suppression interval (unit: seconds). Duplicate alerts within this interval are suppressed.
skip_while_runningbooleanWhether to skip the scheduled run if a previous execution is still in progress
mail_tostringAlert email recipient address. Null if not configured
mail_subjectstringAlert email subject. Null if not configured
created_attimestampCreation timestamp
metadataobjectRuntime metadata (such as bootstrap execution results)

Error codes

Parsing errors
Error codeMessageDescription
95020no-read-permissionThe user does not have cluster administrator permission
Runtime errors

N/A

Description

The system-scheduled-queries command retrieves the configuration and execution status of scheduled queries registered in the system. You can check the name, cron schedule, running status, bootstrap settings, and alert conditions for each scheduled query.

Queries with bootstrap set to true run automatically once at server startup. Use bootstrap_time and bootstrap_error to check the result of bootstrap execution.

Cluster administrator permission is required to run this command.

Examples

  1. Retrieve all scheduled queries

    system-scheduled-queries
    

    Retrieves the configuration and status of all scheduled queries registered in the system.

  2. Retrieve scheduled queries that are currently running

    system-scheduled-queries
    | search running == true
    | fields name, schedule, owner, query_string
    

    Filters and retrieves only scheduled queries that are currently running.

  3. Retrieve disabled scheduled queries

    system-scheduled-queries
    | search enabled == false
    | fields name, schedule, owner
    

    Filters and retrieves only scheduled queries that are in a disabled state.

  4. Retrieve scheduled queries with bootstrap failures

    system-scheduled-queries
    | search bootstrap == true and isnotnull(bootstrap_error)
    | fields name, bootstrap_time, bootstrap_error
    

    Retrieves scheduled queries whose bootstrap execution failed.