API Stability Long-Term

The createSavedQuery() GraphQL mutation may be used to create a saved query in LogScale.

For more information on saved queries, see the User Functions (Saved Searches) reference page where saved queries are discussed. Also, look at the Searching Data documentation page as it relates to recent queries and saving queries.

Syntax

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

graphql
createSavedQuery(
      input: CreateSavedQueryInput!
   ): CreateSavedQueryPayload!

Below is an example of how this mutation field might be used:

Show:
graphql
mutation {
  createSavedQuery( input:
   { name: "my-saved-query",
     viewName: "humio",
     queryString: "@host=localhost"
  }  )
  { savedQuery {id, allowedActions}  }
}
Example Responses
Show:
json
{
  "data": {
    "createSavedQuery": {
      "savedQuery": {
        "id": "S07kKBwioqCaOwkmpz7m9XSfQ9v1eWXb",
        "allowedActions": [
          "Read",
          "Update"
        ]
      }
    }
  }
}

Given Datatypes

For the given datatype, CreateSavedQueryInput, there are several parameters that may be given. Below is a list of them along with a description of each:

Table: CreateSavedQueryInput

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Sep 17, 2024
customLinkInteractions[CustomLinkInteractionInput]yes Long-TermThe custom links for interactions. See CustomLinkInteractionInput.
dashboardLinkInteractions[DashboardLinkInteractionInput]yes Long-TermThe dashboard links for interactions. See DashboardLinkInteractionInput.
endstring  Long-TermThe end point for events processed by the saved query.
isLiveboolean  Long-TermWhether the saved query uses live, streaming data.
namestringyes Long-TermThe name of the saved query to create.
optionsstring  Long-TermAny options related to the saved query.
queryStringstringyes Long-TermThe query to be used, to be saved.
searchLinkInteractions[SearchLinkInteractionInput]yes Long-TermThe search links for interactions. See SearchLinkInteractionInput.
startstring  Long-TermThe start point for events processed by the saved query.
updateParametersInteractions[UpdateParametersInteractionInput]yes Long-TermThe parameters to update for interactions. See UpdateParametersInteractionInput.
viewNamestringyes Long-TermThe name of the view associated with the saved query.
widgetTypestring  Long-TermThe type of widget to use for dispaly the results for the saved query.

Returned Datatypes

CreateSavedQueryPayload has one parameter, but if you click on it in the table below, you'll see that it has several sub-parameters:

Table: CreateSavedQueryPayload

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Sep 24, 2024
savedQuerysavedQueryyes Long-TermThe saved query to create from payload. See savedQuery.