Stability Level Long-Term

The updateAggregateAlertV2() GraphQL mutation is used to change an aggregate alert.

Related to this mutation is the createAggregateAlert() mutation to add a new aggregate alert, enableAggregateAlertV2() and disableAggregateAlertV2() to enable and disable an aggregate alert, and deleteAggregateAlertV2() to delete one.

Syntax

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

graphql
updateAggregateAlertV2(
     input: UpdateAggregateAlertV2!
   ): AggregateAlert!

Below is an example of how you might use this mutation field:

Example

Below is an example of how you might use this mutation field:

Raw
graphql
mutation {
  updateAggregateAlertV2( input:
    {
      viewName: "humio",
      id: "abc123",
      name: "our-aggregate-alert",
      queryString: "#kind=threaddumps | NOT \"(Native Method)\" | top(humioLine)",
      actionIdsOrNames: [ "act-one", "act-two" ],
      labels: [ "admin" ],
      enabled: false,
      throttleTimeSeconds: 100,
      searchIntervalSeconds: 10800,
      queryTimestampType: EventTimestamp,
      triggerMode: CompleteMode,
      queryOwnershipType: User
    }
  )
  { 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 {
  updateAggregateAlertV2( input:
    {
      viewName: \"humio\",
      id: \"abc123\",
      name: \"our-aggregate-alert\",
      queryString: \"#kind=threaddumps | NOT \\"(Native Method)\\" | top(humioLine)\",
      actionIdsOrNames: [ \"act-one\", \"act-two\" ],
      labels: [ \"admin\" ],
      enabled: false,
      throttleTimeSeconds: 100,
      searchIntervalSeconds: 10800,
      queryTimestampType: EventTimestamp,
      triggerMode: CompleteMode,
      queryOwnershipType: User
    }
  )
  { 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 {
  updateAggregateAlertV2( input:
    {
      viewName: \"humio\",
      id: \"abc123\",
      name: \"our-aggregate-alert\",
      queryString: \"#kind=threaddumps | NOT \\"(Native Method)\\" | top(humioLine)\",
      actionIdsOrNames: [ \"act-one\", \"act-two\" ],
      labels: [ \"admin\" ],
      enabled: false,
      throttleTimeSeconds: 100,
      searchIntervalSeconds: 10800,
      queryTimestampType: EventTimestamp,
      triggerMode: CompleteMode,
      queryOwnershipType: User
    }
  )
  { 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 { ^
  updateAggregateAlertV2( input: ^
    { ^
      viewName: \"humio\", ^
      id: \"abc123\", ^
      name: \"our-aggregate-alert\", ^
      queryString: \"#kind=threaddumps | NOT \\"(Native Method)\\" | top(humioLine)\", ^
      actionIdsOrNames: [ \"act-one\", \"act-two\" ], ^
      labels: [ \"admin\" ], ^
      enabled: false, ^
      throttleTimeSeconds: 100, ^
      searchIntervalSeconds: 10800, ^
      queryTimestampType: EventTimestamp, ^
      triggerMode: CompleteMode, ^
      queryOwnershipType: User ^
    } ^
  ) ^
  { id } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  updateAggregateAlertV2( input:
    {
      viewName: \"humio\",
      id: \"abc123\",
      name: \"our-aggregate-alert\",
      queryString: \"#kind=threaddumps | NOT \\"(Native Method)\\" | top(humioLine)\",
      actionIdsOrNames: [ \"act-one\", \"act-two\" ],
      labels: [ \"admin\" ],
      enabled: false,
      throttleTimeSeconds: 100,
      searchIntervalSeconds: 10800,
      queryTimestampType: EventTimestamp,
      triggerMode: CompleteMode,
      queryOwnershipType: User
    }
  )
  { 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 {
  updateAggregateAlertV2( input:
    {
      viewName: \"humio\",
      id: \"abc123\",
      name: \"our-aggregate-alert\",
      queryString: \"#kind=threaddumps | NOT \\"(Native Method)\\" | top(humioLine)\",
      actionIdsOrNames: [ \"act-one\", \"act-two\" ],
      labels: [ \"admin\" ],
      enabled: false,
      throttleTimeSeconds: 100,
      searchIntervalSeconds: 10800,
      queryTimestampType: EventTimestamp,
      triggerMode: CompleteMode,
      queryOwnershipType: User
    }
  )
  { 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 {
  updateAggregateAlertV2( input:
    {
      viewName: \"humio\",
      id: \"abc123\",
      name: \"our-aggregate-alert\",
      queryString: \"#kind=threaddumps | NOT \\"(Native Method)\\" | top(humioLine)\",
      actionIdsOrNames: [ \"act-one\", \"act-two\" ],
      labels: [ \"admin\" ],
      enabled: false,
      throttleTimeSeconds: 100,
      searchIntervalSeconds: 10800,
      queryTimestampType: EventTimestamp,
      triggerMode: CompleteMode,
      queryOwnershipType: User
    }
  )
  { 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 {
  updateAggregateAlertV2( input:
    {
      viewName: \"humio\",
      id: \"abc123\",
      name: \"our-aggregate-alert\",
      queryString: \"#kind=threaddumps | NOT \\"(Native Method)\\" | top(humioLine)\",
      actionIdsOrNames: [ \"act-one\", \"act-two\" ],
      labels: [ \"admin\" ],
      enabled: false,
      throttleTimeSeconds: 100,
      searchIntervalSeconds: 10800,
      queryTimestampType: EventTimestamp,
      triggerMode: CompleteMode,
      queryOwnershipType: User
    }
  )
  { 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
{
  "updateAggregateAlertV2": {
    "id": "abc123"
    }
  }
}

Given Datatype

With the given datatype, you can choose which parameter of the aggregate alert you want to change, such as the actions to take when triggered — which is given by way of a list of IDs or names of those actions you want to use. Below is a list of the parameters for this datatype, along with a description of each.

Table: UpdateAggregateAlertV2

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For return datatypes, this indicates that you must specify which fields you want returned in the results.
Table last updated: Feb 9, 2026
actionIdsOrNames[string]yes Long-TermList of unique identifiers or names of actions to execute on query result. Ten can be added at most. Actions in packages can be referred to as packagescope/packagename:actionname.
descriptionstring  Long-TermA description of the aggregate alert.
enabledbooleanyes Long-TermWhether the aggregate alert is enabled.
idstringyes Long-TermThe unique identifier of the aggregate alert.
labels[string]yes Long-TermThe labels attached to the aggregate alert.
namestringyes Long-TermThe name of the aggregate alert.
queryOwnershipTypeQueryOwnershipTypeyes Long-TermThe ownership of the query run by the aggregate alert. If set to User, ownership will be based on the runAsUserId field. See QueryOwnershipType.
queryStringstringyes Long-TermThe LogScale query to execute.
queryTimestampTypeQueryTimestampTypeyes Long-TermThe type of time stamp to use for the query. See QueryTimestampType for a list of choices.
runAsUserIdstring  Long-TermThe aggregate alert will run with the permissions of the user given here queryOwnershipType is set to User. If it's set to Organization, along with this parameter, an error will occur. ChangeTriggersToRunAsOtherUsers permission is required to set this field.
searchIntervalSecondslongyes Long-TermThe search interval to use in seconds. Valid values are 1-80 minutes in seconds divisible by 60, 82-180 minutes in seconds divisible by 120 and 4-24 hours in seconds divisible by 3600.
throttleFields[string]yes Long-TermThe fields on which to throttle. This can be set only if throttleTimeSeconds is set. Ten throttle fields can be added at most.
throttleTimeSecondslongyes Long-TermThe throttle time in seconds.
triggerModeTriggerModeyes Long-TermThe mode used for triggering the alert. See TriggerMode.
viewNameRepoOrViewNameyes Long-TermThe name of the view of the aggregate alert. RepoOrViewName is a scalar.

Returned Datatype

The returned datatype provides the LogScale query to execute, the actions to take, when the aggregate alert was last triggered, and other information on the aggregate alert. There are several parameters that may be requested. Below is a list of them:

Table: AggregateAlert

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For return datatypes, this indicates that you must specify which fields you want returned in the results.
Table last updated: Feb 10, 2026
actions[Action]yes Long-TermList of actions to fire on query result. See Action.
allowedActions[AssetAction]yes Short-TermList of actions allowed to fire on query result. See AssetAction .
createdInfoAssetCommitMetadata  Long-TermMetadata related to the creation of the aggregate alert. See AssetCommitMetadata.
descriptionstring  Long-TermDescription of the aggregate alert.
enabledbooleanyes Long-TermFlag indicating whether the aggregate alert is enabled.
idstringyes Long-TermUnique identifier of of the aggregate alert.
labels[string]yes Long-TermLabels attached to the aggregate alert.
lastErrorstring  Long-TermLast error encountered while running the aggregate alert.
lastSuccessfulPolllong  Long-TermUnix timestamp for last successful poll of the aggregate alert query. If this isn't very recent, the alert might have problems.
lastTriggeredlong  Long-TermUnix timestamp for last execution of trigger.
lastWarnings[string]yes Long-TermLast warnings encountered while running the aggregate alert.
modifiedInfoModifiedInfoyes Long-TermUser or token used to modify the asset. See ModifiedInfo.
namestringyes Long-TermName of the aggregate alert.
packagePackageInstallation  Long-TermThe package of which the aggregate alert was installed. See PackageInstallation.
packageIdVersionedPackageSpecifier  Long-TermThe unique identifier of the package of the aggregate alert template. VersionedPackageSpecifier is a scalar.
queryOwnershipQueryOwnershipyes Long-TermOwnership of the query run by this alert. See QueryOwnership.
queryStringstringyes Long-TermLogScale query to execute.
queryTimestampTypeQueryTimestampTypeyes Long-TermTimestamp type to use for a query. See QueryTimestampType and the FAQ: How to handle ingest delays in aggregate alerts and scheduled searches KB article.
resourcestringyes Short-TermThe resource identifier for the aggregate alert.
searchIntervalSecondslongyes Long-TermSearch interval in seconds.
throttleFieldstring  DeprecatedThe field on which to throttle. This can be set only if throttleTimeSeconds is set. Aggregate alerts now support multiple throttle fields. This field will be removed at the earliest in version 1.279. Use instead the throttleFields field.
throttleFields[string]  Long-TermThe fields on which to throttle. This can be set only if throttleTimeSeconds is set.
throttleTimeSecondslongyes Long-TermThrottle time in seconds.
triggerModeTriggerModeyes Long-TermTrigger mode used for triggering the alert. See TriggerMode and the FAQ: How to handle ingest delays in aggregate alerts and scheduled searches KB article.
yamlTemplateYAMLyes Long-TermThe yaml specification of the aggregate alert. YAML is a scalar.