Summary

The updateDraftLogCollectorConfiguration() mutation replaces the draft content of an existing Log Collector configuration. A draft stores proposed YAML changes. They have no effect on running Log Collector instances until you publish them. This mutation performs a full replacement — each call overwrites the entire draft with the YAML you provide. Omitting the draft argument clears the current draft. After updating the draft, use publishLogCollectorConfiguration() to apply the changes to the live configuration. This increments the published version.

Syntax

graphql
updateDraftLogCollectorConfiguration(
      id: String!, draft: String
   ): LogCollectorConfiguration!

The id argument is required and identifies the Log Collector configuration to update. The draft argument contains the full YAML configuration content to store as the draft. This argument performs a complete replacement — it overwrites the existing draft rather than merging with it. Omitting draft clears the current draft content. The mutation returns a non-null LogCollectorConfiguration! object.

To verify the saved content, request the draft field in the return. To confirm when the draft was last updated, request draftModifiedAt. To compare the draft against the live configuration, request yaml alongside draft.

To find the configuration identifier, use the logCollectorConfiguration() query shown in the Related section.

Input parameters

Provide the unique identifier of the Log Collector configuration and the full YAML content to store as the draft. Each call performs a complete replacement of the existing draft. To find the configuration identifier, use the logCollectorConfiguration() query.

Table: Input parameters and datatypes

Parameter Type Required Default Description
This table contains all input parameters for this mutation.
draft String     The full YAML content to store as the configuration draft. This argument performs a complete replacement — it overwrites the entire existing draft, not a partial update. Omitting this argument clears the current draft content.
id String! yes   The unique identifier of the Log Collector configuration to update. Retrieve this value from the logCollectorConfiguration() query.

Example

Raw
graphql
mutation {
  updateDraftLogCollectorConfiguration( 
      id: "abc123",
      draft: "something"
  )
  { 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 {
  updateDraftLogCollectorConfiguration( 
      id: \"abc123\",
      draft: \"something\"
  )
  { 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 {
  updateDraftLogCollectorConfiguration( 
      id: \"abc123\",
      draft: \"something\"
  )
  { 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 { ^
  updateDraftLogCollectorConfiguration(  ^
      id: \"abc123\", ^
      draft: \"something\" ^
  ) ^
  { id } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  updateDraftLogCollectorConfiguration( 
      id: \"abc123\",
      draft: \"something\"
  )
  { 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 {
  updateDraftLogCollectorConfiguration( 
      id: \"abc123\",
      draft: \"something\"
  )
  { 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 {
  updateDraftLogCollectorConfiguration( 
      id: \"abc123\",
      draft: \"something\"
  )
  { 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 {
  updateDraftLogCollectorConfiguration( 
      id: \"abc123\",
      draft: \"something\"
  )
  { 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
{
  "updateDraftLogCollectorConfiguration": {
    "id": "abc123"
    }
  }
}

Returned values

The mutation returns a LogCollectorConfiguration! object reflecting the state after the draft update. The following table lists the available fields.

Key fields to request: draft returns the YAML content now stored as the draft, confirming what was saved. draftModifiedAt returns the timestamp of the most recent draft update. To compare the draft against the current live configuration, request yaml alongside draft. These fields are independent: yaml holds the last published configuration and does not change until you call publishLogCollectorConfiguration(). modifiedAt and modifiedBy reflect the last publish operation, not the draft update. version is the published version integer and increments only on publish. instances returns the number of Log Collector instances currently using this configuration.

Table: LogCollectorConfiguration Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
descriptionString  Short-Term A description of the Log Collector configuration.
draftString  Short-Term The configuration draft.
draftModifiedAtDateTime  Short-Term The date and time of the last draft of the configuration.
idStringyes Short-Term The unique identifier for the log collector configuration.
instancesIntyes Short-Term The number of instances.
isTestRunningBooleanyes Short-Term Whether a test is running.
modifiedAtDateTimeyes Short-Term The date and time of the current configuration.
modifiedByStringyes Short-Term Who last modified the configuration.
nameStringyes Short-Term The name assigned to the log collector configuration.
versionIntyes Short-Term The version used.
yamlString  Short-Term Configuration in YAML format.
yamlCharactersCountIntyes Short-Term The yaml character count.