Summary

The updateCustomLinkInteraction() mutation modifies an existing custom link interaction associated with a LogScale repository. Custom link interactions define URL templates that generate clickable links from event field values in search results. The URL template uses {{ fields.fieldName }} placeholders, which LogScale replaces with the corresponding field values when rendering results. Use this mutation to change the interaction name, URL template, tab behavior, URL encoding, or field match conditions after the interaction has been created. To create a new custom link interaction, use createCustomLinkInteraction() instead.

Syntax

graphql
updateCustomLinkInteraction(
      input: UpdateCustomLinkInteractionInput!
   ): InteractionId!

The mutation accepts a single required input argument of type UpdateCustomLinkInteractionInput!. The input requires a path field that identifies the target repository, an interactionId field that specifies the interaction to update, and a customLinkInteractionInput object containing the updated interaction properties. See the Input Parameters section for the full list of fields.

The mutation returns an InteractionId! object. Request the id field to obtain the unique identifier of the updated interaction. Use this identifier in subsequent calls to updateCustomLinkInteraction() or deleteInteractionV2().

Example

Raw
graphql
mutation {
  updateCustomLinkInteraction( input:
    {
      path: "humio",
      interactionId: "abc123",
      customLinkInteractionInput: { name: "our-link",
                                    urlTemplate: "https://company.com?q={{ fields.myField }}",
                                    openInNewTab: false }
    }
  )
  { 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 {
  updateCustomLinkInteraction( input:
    {
      path: \"humio\",
      interactionId: \"abc123\",
      customLinkInteractionInput: { name: \"our-link\",
                                    urlTemplate: \"https://company.com?q={{ fields.myField }}\",
                                    openInNewTab: false }
    }
  )
  { 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 {
  updateCustomLinkInteraction( input:
    {
      path: \"humio\",
      interactionId: \"abc123\",
      customLinkInteractionInput: { name: \"our-link\",
                                    urlTemplate: \"https://company.com?q={{ fields.myField }}\",
                                    openInNewTab: false }
    }
  )
  { 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 { ^
  updateCustomLinkInteraction( input: ^
    { ^
      path: \"humio\", ^
      interactionId: \"abc123\", ^
      customLinkInteractionInput: { name: \"our-link\", ^
                                    urlTemplate: \"https://company.com?q={{ fields.myField }}\", ^
                                    openInNewTab: false } ^
    } ^
  ) ^
  { id } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  updateCustomLinkInteraction( input:
    {
      path: \"humio\",
      interactionId: \"abc123\",
      customLinkInteractionInput: { name: \"our-link\",
                                    urlTemplate: \"https://company.com?q={{ fields.myField }}\",
                                    openInNewTab: false }
    }
  )
  { 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 {
  updateCustomLinkInteraction( input:
    {
      path: \"humio\",
      interactionId: \"abc123\",
      customLinkInteractionInput: { name: \"our-link\",
                                    urlTemplate: \"https://company.com?q={{ fields.myField }}\",
                                    openInNewTab: false }
    }
  )
  { 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 {
  updateCustomLinkInteraction( input:
    {
      path: \"humio\",
      interactionId: \"abc123\",
      customLinkInteractionInput: { name: \"our-link\",
                                    urlTemplate: \"https://company.com?q={{ fields.myField }}\",
                                    openInNewTab: false }
    }
  )
  { 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 {
  updateCustomLinkInteraction( input:
    {
      path: \"humio\",
      interactionId: \"abc123\",
      customLinkInteractionInput: { name: \"our-link\",
                                    urlTemplate: \"https://company.com?q={{ fields.myField }}\",
                                    openInNewTab: false }
    }
  )
  { 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
{
  "updateCustomLinkInteraction": {
    "id": "abc123"
    }
  }
}

Input Parameters

The input argument accepts an UpdateCustomLinkInteractionInput object. This object requires a path field that identifies the target repository, an interactionId field that specifies the interaction to update, and a customLinkInteractionInput object that specifies the updated interaction name, URL template, tab behavior, URL encoding, and match conditions. The URL template supports {{ fields.fieldName }} placeholders that LogScale replaces with event field values when rendering search results. The following tables describe the available fields and the sub-types they reference:

Table: UpdateCustomLinkInteractionInput Input Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
customLinkInteractionInputCustomLinkInteractionInputyes Long-Term The custom link for interactions. See CustomLinkInteractionInput.
interactionIdStringyes Long-Term The unique identifier of the interactions.
pathStringyes Long-Term The path to the custom link.

The UpdateCustomLinkInteractionInput type references a CustomLinkInteractionInput sub-type. The following table describes that sub-type:

Table: CustomLinkInteractionInput Input Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
fieldInteractionConditionsFieldInteractionConditionInputyes Long-Term The field interaction conditions. See FieldInteractionConditionInput.
nameStringyes Long-Term The name of the field.
openInNewTabBooleanyes Long-Term Whether to open in a new tab.
titleTemplateString  Long-Term The title template.
urlEncodeArgsBoolean  Long-Term The URL encode arguments.
urlTemplateStringyes Long-Term The URL template.

Returned Values

The mutation returns an InteractionId! object containing the unique identifier of the updated custom link interaction. Request the id field to obtain this value. Use the identifier in subsequent calls to updateCustomLinkInteraction() or deleteInteractionV2(). The following table describes the returned type:

Table: InteractionId Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
idStringyes Long-Term The unique identifier for the interaction.