Summary

The updateSavedQuery() mutation updates a saved query in a LogScale repository or view. A saved query stores a query string, an optional time range, an execution mode, a display name, a widget type, organizational labels, and interaction links for drilldowns. This mutation replaces any combination of those properties on the record. To create a new saved query, use createSavedQuery() instead.

Syntax

graphql
updateSavedQuery(
      input: UpdateSavedQueryInput!
   ): UpdateSavedQueryPayload!

The mutation accepts a single required input argument of type UpdateSavedQueryInput!. Provide the view or repository name, the saved query identifier, and the properties to update. To retrieve the saved query identifier, use the repository() query.

The mutation returns an UpdateSavedQueryPayload object containing the updated SavedQuery record.

Hide Query Example

Show Saved Query Identifiers Query

Input parameters

The input argument requires two fields: viewName and id. The viewName field accepts a repository name or a view name; views are read-only abstractions over one or more repositories and are valid scopes for this mutation. The id field is the system-generated unique identifier for the saved query, not its display name — use the repository() query to retrieve it.

The following optional fields control the saved query content:

  • queryString — the LogScale query language string to execute. Providing this field replaces the entire query.

  • isLive — when true, the saved query runs continuously against live, streaming data. When false, the query runs over a fixed time range defined by start and end.

  • start and end — the time range boundaries for static (non-live) queries, expressed as relative offsets (for example, 24h) or absolute timestamps. These fields have no effect when isLive is true.

  • name — the display name of the saved query as shown in the LogScale UI.

  • description — a short description of the saved query's purpose.

  • widgetType — the visualization widget to use when displaying the query results in a dashboard panel.

  • labels — a list of organizational labels to apply to the saved query. This field replaces the full existing label set. To add or remove individual labels without replacing all of them, use addSavedQueryLabels() or removeSavedQueryLabels() instead.

  • customLinkInteractions, dashboardLinkInteractions, searchLinkInteractions, and updateParametersInteractions — configure the drilldown and cross-link behaviors available when a user selects a field value in the query results.

  • options — additional display or execution options for the saved query.

Table: UpdateSavedQueryInput Input Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
customLinkInteractionsCustomLinkInteractionInputyes Long-Term The custom links for interactions. See CustomLinkInteractionInput.
dashboardLinkInteractionsDashboardLinkInteractionInputyes Long-Term The dashboard links for interactions. See DashboardLinkInteractionInput.
descriptionString     
endString  Long-Term The ending point of the saved query.
idStringyes Long-Term The unique identifier of the saved query to update.
isLiveBoolean  Long-Term Whether the saved query is executed continuously on live, streaming data.
labelsStringyes    
nameString  Long-Term The name of the saved query to update.
optionsString  Long-Term Any options related to the saved query.
queryStringString  Long-Term The new query.
searchLinkInteractionsSearchLinkInteractionInputyes Long-Term The search links for interactions. See SearchLinkInteractionInput.
startString  Long-Term The starting point of the saved query.
updateParametersInteractionsUpdateParametersInteractionInputyes Long-Term The parameters to update for interactions. See UpdateParametersInteractionInput.
viewNameStringyes Long-Term The name of the view associated with the saved query.
widgetTypeString  Long-Term The type of widget for displaying the results of the saved query.

Example

Raw
graphql
mutation {
  updateSavedQuery( input:
     { id: "abc123",
       viewName: "humio",
       isLive: false
     } 
  )
  { savedQuery { id } }
}
Mac OS or Linux (curl)
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  updateSavedQuery( input:
     { id: \"abc123\",
       viewName: \"humio\",
       isLive: false
     } 
  )
  { savedQuery { id } }
}"
}
EOF
Mac OS or Linux (curl) One-line
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  updateSavedQuery( input:
     { id: \"abc123\",
       viewName: \"humio\",
       isLive: false
     } 
  )
  { savedQuery { id } }
}"
}
EOF
Windows Cmd and curl
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql ^
    -H "Authorization: Bearer $TOKEN" ^
    -H "Content-Type: application/json" ^
    -d @'{"query" : "mutation { ^
  updateSavedQuery( input: ^
     { id: \"abc123\", ^
       viewName: \"humio\", ^
       isLive: false ^
     }  ^
  ) ^
  { savedQuery { id } } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  updateSavedQuery( input:
     { id: \"abc123\",
       viewName: \"humio\",
       isLive: false
     } 
  )
  { savedQuery { id } }
}"
}'
    "$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $query = "mutation {
  updateSavedQuery( input:
     { id: \"abc123\",
       viewName: \"humio\",
       isLive: false
     } 
  )
  { savedQuery { id } }
}";
$query =~ s/\n/ /g;
my $json = sprintf('{"query" : "%s"}',$query);
my $req = HTTP::Request->new("POST", $uri );

$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");

$req->content( $json );

my $lwp = LWP::UserAgent->new;

my $result = $lwp->request( $req );

print $result->{"_content"},"\n";
Python
python
#! /usr/local/bin/python3

import requests

url = '$YOUR_LOGSCALE_URL/graphql'
mydata = r'''{"query" : "mutation {
  updateSavedQuery( input:
     { id: \"abc123\",
       viewName: \"humio\",
       isLive: false
     } 
  )
  { savedQuery { id } }
}"
}'''

resp = requests.post(url,
                     data = mydata,
                     headers = {
   "Authorization" : "Bearer $TOKEN",
   "Content-Type" : "application/json"
}
)

print(resp.text)
Node.js
javascript
const https = require('https');

const data = JSON.stringify(
    {"query" : "mutation {
  updateSavedQuery( input:
     { id: \"abc123\",
       viewName: \"humio\",
       isLive: false
     } 
  )
  { savedQuery { id } }
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL',
  path: 'graphql',
  port: 443,
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length,
    Authorization: 'BEARER ' + process.env.TOKEN,
    'User-Agent': 'Node',
  },
};

const req = https.request(options, (res) => {
  let data = '';
  console.log(`statusCode: ${res.statusCode}`);

  res.on('data', (d) => {
    data += d;
  });
  res.on('end', () => {
    console.log(JSON.parse(data).data);
  });
});

req.on('error', (error) => {
  console.error(error);
});

req.write(data);
req.end();
Example Responses
Success (HTTP Response Code 200 OK)
json
{
  "data": {
    "updateSavedQuery": {
      "savedQuery": {
        "id": "abc123"
      }
    }
  }
}

Returned values

The mutation returns an UpdateSavedQueryPayload object. The savedQuery field contains the full updated SavedQuery record, including its identifier, display name, labels, widget type, and audit metadata such as creation and modification timestamps. The clientMutationId field is deprecated as of version 1.106 and returns null.

Table: UpdateSavedQueryPayload Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
savedQuerySavedQueryyes Long-Term The saved query to update. See SavedQuery.

The savedQuery field references the SavedQuery datatype:

Table: SavedQuery Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
allowedActionsAssetActionyes Short-Term The allowed asset actions. See AssetAction . This is a preview and subject to change.
createdInfoAssetCommitMetadata  Long-Term Metadata related to the creation of the saved query. See AssetCommitMetadata.
descriptionString  Long-Term A description of the saved query.
displayNameStringyes Long-Term The display name of the saved query.
idStringyes Long-Term The unique identifier for the saved query.
interactionsQueryBasedWidgetInteractionyes Long-Term The interactions of the saved query. See QueryBasedWidgetInteraction.
isStarredBooleanyes Long-Term Whether the saved query has been marked with a star.
labelsStringyes Long-Term The labels associated with this saved query.
modifiedInfoAssetCommitMetadata  Long-Term Metadata related to the latest modification of the saved query. See AssetCommitMetadata.
nameStringyes Long-Term The name of the saved query.
optionsJSONyes Long-Term Options related to the saved query, in JSON form. JSON is a scalar.
packagePackageInstallation  Long-Term The package, if there is one, in which the saved query is included. See PackageInstallation.
packageIdVersionedPackageSpecifier  Long-Term The unique identifier of the package. VersionedPackageSpecifier is a scalar value.
qualifiedNameStringyes Preview The fully qualified reference format, including the view.
queryHumioQueryyes Long-Term The saved query itself. See HumioQuery.
resourceStringyes Short-Term The resource identifier for this saved query.
templateYamlStringyes  deprecated in 1.225A YAML formatted string that describes the saved query.
widgetTypeStringyes Long-Term The type of widget used with the saved query.
yamlTemplateYAMLyes Long-Term A yaml formatted string that describes the saved query. YAML is a scalar. This replaced templateYaml starting in LogScale version 1.225.