Summary

The updateLogCollectorConfigurationDescription() mutation sets a new description for an existing Log Collector configuration. Use it after creating a configuration with createLogCollectorConfiguration() or when you want to document the collector's purpose or deployment context more precisely. To change the configuration name instead, use updateLogCollectorConfigurationName().

Syntax

graphql
updateLogCollectorConfigurationDescription(
      configId: String!, description: String
   ): LogCollectorConfiguration!

The configId argument is required and identifies the Log Collector configuration to update. The description argument is optional; pass null or omit it to clear the existing description. The mutation returns the updated LogCollectorConfiguration! object.

Input parameters

Provide the unique identifier of the Log Collector configuration and the new description text. Use logCollectorConfiguration() to retrieve the configuration ID before calling this mutation.

Table: Input parameters and datatypes

Parameter Type Required Default Description
This table contains all input parameters for this mutation.
configId String yes   The unique identifier of the Log Collector configuration to update. Retrieve this value using logCollectorConfiguration().
description String     The new description text for the configuration. Pass null or omit this argument to clear the existing description.

Example

Raw
graphql
mutation {
  updateLogCollectorConfigurationDescription( 
     configId: "abc123",
     description: "The Log Collector"
  )
 { name }
}
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 {
  updateLogCollectorConfigurationDescription( 
     configId: \"abc123\",
     description: \"The Log Collector\"
  )
 { name }
}"
}
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 {
  updateLogCollectorConfigurationDescription( 
     configId: \"abc123\",
     description: \"The Log Collector\"
  )
 { name }
}"
}
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 { ^
  updateLogCollectorConfigurationDescription(  ^
     configId: \"abc123\", ^
     description: \"The Log Collector\" ^
  ) ^
 { name } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  updateLogCollectorConfigurationDescription( 
     configId: \"abc123\",
     description: \"The Log Collector\"
  )
 { name }
}"
}'
    "$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 {
  updateLogCollectorConfigurationDescription( 
     configId: \"abc123\",
     description: \"The Log Collector\"
  )
 { name }
}";
$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 {
  updateLogCollectorConfigurationDescription( 
     configId: \"abc123\",
     description: \"The Log Collector\"
  )
 { name }
}"
}'''

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 {
  updateLogCollectorConfigurationDescription( 
     configId: \"abc123\",
     description: \"The Log Collector\"
  )
 { name }
}"
}
);


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": {
    "updateLogCollectorConfigurationDescription": {
      "name": "our-logcollector"
    }
  }
}

Returned values

The mutation returns the updated LogCollectorConfiguration! object. The returned data includes the configuration name, description, YAML configuration content, the user who last modified it, the modification timestamp, and the version of Log Collector in use.

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.