Summary

When an alert or scheduled search fires, a repository action forwards matching event data to another LogScale repository for further analysis, archiving, or cross-team visibility. The updateHumioRepoAction() mutation updates an existing repository action of this type. Use it to change the action name, the ingest token for the destination repository, or the labels assigned to the action. To create a new repository action, use createHumioRepoAction() instead.

Syntax

graphql
updateHumioRepoAction(
      input: UpdateHumioRepoAction!
   ): HumioRepoAction!

The mutation takes a single required input argument of type UpdateHumioRepoAction!. Provide the name of the owning repository or view in viewName, the unique identifier of the action to update in id, and an updated action name in name. The ingestToken argument specifies the ingest token for the destination repository that receives the forwarded event data — changing this value redirects where the action sends events. The labels argument is optional. Use the repository() query shown in the Related section to retrieve the action identifier before calling this mutation. The mutation returns a non-null HumioRepoAction! object.

Input parameters

The viewName argument specifies the repository or view that owns the action — this is the source side, not the destination. The id argument specifies the unique identifier of the action to update; retrieve it using the repository() query shown in the Related section. The name argument sets the action name, which must be unique within the owning repository. The ingestToken argument provides the ingest token for the destination repository that receives the forwarded event data; updating this value redirects where matching events are sent. The labels argument is optional and accepts a list of strings to categorize the action.

Table: UpdateHumioRepoAction Input Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
idStringyes Long-Term The unique identifier of the action.
ingestTokenStringyes Long-Term LogScale ingest token for the dataspace into which the action should ingest.
labelsStringyes   Labels to categorize the action.
nameStringyes Long-Term The name of the action.
viewNameStringyes Long-Term The name of the view of the action.

Example

Raw
graphql
mutation {
  updateHumioRepoAction( input:
    { viewName: "humio",
      id: "def456",
      name: "WakeUp"
      ingestToken: "abc123"
    }
  )
  { 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 {
  updateHumioRepoAction( input:
    { viewName: \"humio\",
      id: \"def456\",
      name: \"WakeUp\"
      ingestToken: \"abc123\"
    }
  )
  { 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 {
  updateHumioRepoAction( input:
    { viewName: \"humio\",
      id: \"def456\",
      name: \"WakeUp\"
      ingestToken: \"abc123\"
    }
  )
  { 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 { ^
  updateHumioRepoAction( input: ^
    { viewName: \"humio\", ^
      id: \"def456\", ^
      name: \"WakeUp\" ^
      ingestToken: \"abc123\" ^
    } ^
  ) ^
  { id } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  updateHumioRepoAction( input:
    { viewName: \"humio\",
      id: \"def456\",
      name: \"WakeUp\"
      ingestToken: \"abc123\"
    }
  )
  { 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 {
  updateHumioRepoAction( input:
    { viewName: \"humio\",
      id: \"def456\",
      name: \"WakeUp\"
      ingestToken: \"abc123\"
    }
  )
  { 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 {
  updateHumioRepoAction( input:
    { viewName: \"humio\",
      id: \"def456\",
      name: \"WakeUp\"
      ingestToken: \"abc123\"
    }
  )
  { 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 {
  updateHumioRepoAction( input:
    { viewName: \"humio\",
      id: \"def456\",
      name: \"WakeUp\"
      ingestToken: \"abc123\"
    }
  )
  { 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();

Returned values

The mutation returns a non-null HumioRepoAction! object representing the updated action. Include id in the return fields to retain the action identifier for use with subsequent mutations such as testHumioRepoAction() or deleteActionV2(). The ingestToken field returns the token used by the action to write to the destination repository. The isAllowedToRun field indicates whether the action is currently permitted to execute. The requiresOrganizationOwnedQueriesPermissionToEdit field indicates whether the action is used by organization-owned triggers; if true, the OrganizationOwnedQueries permission is required to edit it. The yamlTemplate field returns a YAML representation of the action suitable for export or recreation. The createdInfo and modifiedInfo fields return commit metadata including timestamps and the identity of the user who last modified the action.

Table: HumioRepoAction Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
allowedActions[AssetAction]yes Short-Term The allowed asset actions. This is a preview and may change. See AssetAction .
createdInfoAssetCommitMetadata  Long-Term Metadata related to the creation of the action. See AssetCommitMetadata.
displayNamestringyes Long-Term The display name of the action.
idstringyes Long-Term The unique identifier of the action.
ingestTokenstringyes Long-Term The LogScale ingest token for the dataspace into which the action should ingest.
isAllowedToRunbooleanyes Long-Term Whether this type of action is allowed.
labels[string]  Preview A list of actions, if any, associated with the action.
modifiedInfoAssetCommitMetadata  Long-Term Metadata related to the latest modification of the action. See AssetCommitMetadata.
namestringyes Long-Term The name of the action.
packagePackageInstallation  Long-Term The package, if any, of which the action is part (see PackageInstallation Table).
packageIdVersionedPackageSpecifier  Long-Term The unique identifier of the package used. VersionedPackageSpecifier is a scalar.
requiresOrganizationOwnedQueriesPermissionToEditbooleanyes Long-Term Whether this action is used by triggers, where the query is run by the organization. The OrganizationOwnedQueries permission is required to edit the action.
resourcestringyes Short-Term The resource identifier for the action.
yamlTemplateYAMLyes Long-Term A template that can be used to recreate the action. YAML is a scalar.