The createScheduledSearch() GraphQL mutation may be used to create a scheduled search in LogScale.

For more information on scheduled searches, see the Scheduled Searches documentation page. Also, look at the Searching Data documentation page as it relates to saving queries.

Syntax

Below is the syntax for the createScheduledSearch() mutation field:

graphql
createScheduledSearch(
      input: CreateScheduledSearch!
   ): ScheduledSearch!

Given Datatypes

For the given datatype, createScheduledSearch(), there are several parameters that may be given. Below is a list of them along with their datatypes and a description of each:

Table: CreateScheduledSearch

ParameterTypeRequired[a]DefaultDescription
viewNamestringyes Name of the view of the scheduled search.
namestringyes Name of the scheduled search.
descriptionstringyes Description of the scheduled search.
queryStringstringyes LogScale query to execute.
queryStartstringyes Start of the relative time interval for the query.
queryEndbooleanyes End of the relative time interval for the query.
schedulestringyes Cron pattern describing the schedule to execute the query on.
timeZonestringyes Time zone of the schedule. Currently this field only supports UTC offsets like 'UTC', 'UTC-01' or 'UTC+12:45'.
backfillLimitintegeryes User-defined limit, which caps the number of missed searches to backfill, e.g. in the event of a shutdown.
enabledboolean = true  Flag indicating whether the scheduled search is enabled.
actions[string]yes List of Ids for actions to fire on query result.
labels[string]yes Labels attached to the scheduled search.

[a] Some arguments may be required, as indicated in this column. For some fields, this column indicates that a result will always be returned for it.


Returned Datatypes

The returned datatype ScheduledSearch has its own parameters. Below is a list of them along with their datatypes and a description of each:

Table: ScheduledSearch

ParameterTypeRequired[a]DefaultDescription
idstringyes The unique identifier of the scheduled search.
namestringyes The name of the scheduled search.
descriptionstring  A description of the scheduled search.
queryStringstringyes The LogScale query to execute.
startstringyes The start of the relative time interval for the query.
endstringyes The end of the relative time interval for the query.
timeZonestringyes Time zone of the schedule. Currently, this field only supports UTC offsets like 'UTC', 'UTC-01' or 'UTC+12:45'.
schedulestringyes The cron pattern describing the schedule to execute the query on.
backfillLimitintegeryes User-defined limit, which caps the number of missed searches to backfill, e.g. in the event of a shutdown.
enabledbooleanyes Whether the scheduled search is enabled.
actions[string]yes List of unique identifiers for actions to fire on query result.
runAsUserUseryes The unique identifier of the user as which the scheduled search is running (see User Table).
lastScheduledSearchlong  The UNIX timestamp at which the last query result was processed.
timeOfNextPlannedExecutionlong  The UNIX timestamp for next planned search.
lastErrorstring  The last error encountered while running the search.
labels[string]yes The labels added to the scheduled search.
isStarredbooleanyes Whether the calling user has 'starred' the scheduled search.
yamlTemplateYAMLyes A template that can be used to recreate the scheduled search.
packagePackageInstallationyes The related package (see PackageInstallation Table).

[a] Some arguments may be required, as indicated in this column. For some fields, this column indicates that a result will always be returned for it.