Summary

The gcsConfigureArchiving() mutation configures Google Cloud Storage (GCS) archiving for a repository. It sets the target bucket, archive format, optional tag ordering for output filenames, and an optional time window that bounds which data the archiving covers. After configuring, call enableArchiving() to start writing log segments to the bucket.

API Stability Preview

Syntax

graphql
gcsConfigureArchiving(
      repositoryName: String!,
      bucket: String!,
      format: ArchivingFormat!,
      tagOrderInName: [String!],
      startFromDateTime: DateTime,
      endAtDateTime: DateTime
   ): BooleanResultType!

The required parameters are repositoryName, bucket, and format. The mutation returns a non-null BooleanResultType indicating whether the configuration was saved successfully.

Example

Raw
graphql
mutation {
  gcsConfigureArchiving( 
      repositoryName: "humio",
      bucket: "pale-1",
      format: NDJSON,
      tagOrderInName: ["admin", "other"],
  )
  { result }
}
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 {
  gcsConfigureArchiving( 
      repositoryName: \"humio\",
      bucket: \"pale-1\",
      format: NDJSON,
      tagOrderInName: [\"admin\", \"other\"],
  )
  { result }
}"
}
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 {
  gcsConfigureArchiving( 
      repositoryName: \"humio\",
      bucket: \"pale-1\",
      format: NDJSON,
      tagOrderInName: [\"admin\", \"other\"],
  )
  { result }
}"
}
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 { ^
  gcsConfigureArchiving(  ^
      repositoryName: \"humio\", ^
      bucket: \"pale-1\", ^
      format: NDJSON, ^
      tagOrderInName: [\"admin\", \"other\"], ^
  ) ^
  { result } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  gcsConfigureArchiving( 
      repositoryName: \"humio\",
      bucket: \"pale-1\",
      format: NDJSON,
      tagOrderInName: [\"admin\", \"other\"],
  )
  { result }
}"
}'
    "$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 {
  gcsConfigureArchiving( 
      repositoryName: \"humio\",
      bucket: \"pale-1\",
      format: NDJSON,
      tagOrderInName: [\"admin\", \"other\"],
  )
  { result }
}";
$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 {
  gcsConfigureArchiving( 
      repositoryName: \"humio\",
      bucket: \"pale-1\",
      format: NDJSON,
      tagOrderInName: [\"admin\", \"other\"],
  )
  { result }
}"
}'''

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 {
  gcsConfigureArchiving( 
      repositoryName: \"humio\",
      bucket: \"pale-1\",
      format: NDJSON,
      tagOrderInName: [\"admin\", \"other\"],
  )
  { result }
}"
}
);


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": {
    "gcsConfigureArchiving": {
      "result": true
    }
  }
}

Input Parameters

Provide the repository name, target bucket, and output format. The optional parameters narrow the archiving time window and control how tag field values appear in output filenames.

Table: Input Parameters & Datatypes

Parameter Type Required Default Description
This table contains all input parameters for this mutation. The ArchivingFormat enum values appear in the table that follows.
bucket string yes   The name of the GCS bucket that receives archived log segments.
endAtDateTime datetime     The timestamp at which archiving stops. When omitted, archiving continues indefinitely.
format ArchivingFormat yes   The file format for archived segments stored in the bucket. Accepted values are defined in the ArchivingFormat enum.
repositoryName string yes   The name of the LogScale repository to configure for GCS archiving.
startFromDateTime datetime     The timestamp from which archiving begins. When omitted, archiving starts from the earliest available data.
tagOrderInName string list     An ordered list of tag field names to include in archived output filenames. The tags appear in the filename in the order provided. When omitted, no tag fields appear in output filenames.

The format parameter accepts one of the values defined in the ArchivingFormat enum:

Returned Values

The mutation returns a BooleanResultType, which indicates whether the archiving configuration was saved successfully. A true result confirms that the GCS archiving settings are stored for the repository. Call enableArchiving() to start the archiving job.

Table: BooleanResultType Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
Some input parameters may be required, as indicated in the Required column. For return values, this indicates that you are assured a value if the field is requested for the results. 
Table last updated: Oct 14, 2026 
resultBooleanyes Long-Term Whether the mutation was performed successfully.