The repositories() GraphQL query returns a list of repositories.

For information on creating a repository, see the Creating a Repository or View documentation page. You may also want to look at the Repositories & Views and Repositories pages for related information.

Syntax

Below is the syntax for the repositories() query field:

graphql
repositories(
     includeSandboxes: boolean,
     includeHidden: boolean
   ): [Repository!]!

When using the repositories() query, the includeSandboxes and includeHidden parameters are optional — they're set to true by default.

For the Repository returned , datatype you'll have to specify which values you want. Below is an example with a few values requested:

Raw
graphql
query {
  repositories(includeHidden: true, includeSandboxes: false)
  {name, id, awsExternalId, type, dataType, dashboards {
    id, name, displayName
  }, timeOfLatestIngest}
}
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" : "query {
  repositories(includeHidden: true, includeSandboxes: false)
  {name, id, awsExternalId, type, dataType, dashboards {
    id, name, displayName
  }, timeOfLatestIngest}
}"
}
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" : "query {
  repositories(includeHidden: true, includeSandboxes: false)
  {name, id, awsExternalId, type, dataType, dashboards {
    id, name, displayName
  }, timeOfLatestIngest}
}"
}
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" : "query { ^
  repositories(includeHidden: true, includeSandboxes: false) ^
  {name, id, awsExternalId, type, dataType, dashboards { ^
    id, name, displayName ^
  }, timeOfLatestIngest} ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "query {
  repositories(includeHidden: true, includeSandboxes: false)
  {name, id, awsExternalId, type, dataType, dashboards {
    id, name, displayName
  }, timeOfLatestIngest}
}"
}'
"$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $INGEST_TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $json = '{"query" : "query {
  repositories(includeHidden: true, includeSandboxes: false)
  {name, id, awsExternalId, type, dataType, dashboards {
    id, name, displayName
  }, timeOfLatestIngest}
}"
}';
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" : "query {
  repositories(includeHidden: true, includeSandboxes: false)
  {name, id, awsExternalId, type, dataType, dashboards {
    id, name, displayName
  }, timeOfLatestIngest}
}"
}'''

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" : "query {
  repositories(includeHidden: true, includeSandboxes: false)
  {name, id, awsExternalId, type, dataType, dashboards {
    id, name, displayName
  }, timeOfLatestIngest}
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL/graphql',
  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": {
    "repositories": [
      {
        "timeOfLatestIngest": "2024-10-30T12:09:49.909Z",
        "id": "aK9GKAsTnMXfRxT8Fpecx3fX",
        "awsExternalId": "SINGLE_ORGANIZATION_ID/aK9GKAsTnMXfRxT8Fpecx3fX",
        "name": "humio",
        "dashboards": [
          {
            "id": "pKZuBbLOqlXonJBJrBnLAQAlele9e9tm",
            "name": "Parsers",
            "displayName": "Parsers"
          },
          {
            "id": "fn0aLMtXg0M4zJ5v1Qyft7aIwzRkhy4W",
            "name": "Overview",
            "displayName": "Overview"
          },
          {
            "id": "sVDzR6aL93MFnVtzyNJZmFR2vnqlnLgj",
            "name": "Request-Response",
            "displayName": "Request-Response"
          },
          {
            "id": "G7nWm1GJ2NG8oGv5K0eCxaAtYG6gsr3x",
            "name": "Ingest",
            "displayName": "Ingest"
          },
        ... 
        ],
        "dataType": "ANYDATA",
        "type": "SYSTEM"
      },
      ... 
      {
        "timeOfLatestIngest": "2024-10-30T12:09:16.569Z",
        "id": "N7t1bAn6xWMsWjVptueeNR16",
        "awsExternalId": "SINGLE_ORGANIZATION_ID/N7t1bAn6xWMsWjVptueeNR16",
        "name": "humio-metrics",
        "dashboards": [],
        "dataType": "ANYDATA",
        "type": "SYSTEM"
      },
    ... 
    ]
  }
}

In this example, the results shown have been truncated.

Returned Datatypes

The returned datatype repository has several parameters. Below is a list of them along with a description of each:

Table: Repository

ParameterTypeRequiredDefaultDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Oct 3, 2024
actionmultipleyes A saved action. The multiple datatype consists of (id: string): Action. See Action.
actions[Action]yes A list of saved actions. See Action.
aggregateAlertmultipleyes A saved aggregate alert. The multiple datatype consists of (id: string): AggregateAlert. See AggregateAlert.
aggregateAlerts[AggregateAlert]yes A list of saved aggregate alerts. See AggregateAlert.
alertmultipleyes A saved alert. The multiple datatype consists of (id: string): Alert. See Alert.
alerts[Alert]yes Saved alerts. See Alert.
allowedViewActions[ViewAction]yes Returns the all actions the user is allowed to perform on the view. See ViewAction.
automaticSearchbooleanyes Whether to search automatically.
availablePackagesmultipleyes Returns a list of available packages that can be installed. The multiple datatype consists of (filter: string, tags: [PackageTag], categories: [string]): [PackageRegistrySearchResultItem]. See PackageRegistrySearchResultItem.
awsExternalIdstringyes The AWS External ID used when assuming roles in AWS on behalf of this repository.
cachePolicyCachePolicy  The cache policy set on the repository. This is a preview and subject to change. See CachePolicy.
compressedByteSizelongyes Total size of data, measured as the size after compression.
compressedByteSizeOfMergedlongyes Total size of data, merged parts. Size is measured as the size after compression.
currentTagGroupings[TagGroupingRule]yes Tag grouping rules applied on the repository currently. Rules only apply to the tags they denote, and tags without rules do not have any grouping. See TagGroupingRule.
dashboardmultipleyes A saved dashboard. The multiple datatype consists of (id: string): Dashboard. See Dashboard.
dashboards[Dashboard]yes All dashboards available on the view. See Dashboard.
datasources[Datasource]yes Data sources from where data is ingested: specific log files or services sending data to LogScale. See Datasource.
dataTypeRepositoryDataTypeyes Repository data types are used for controlling the types of data are allowed in the repository. See RepositoryDataType.
defaultQuerySavedQuery  The default saved query for the repository. See SavedQuery.
deletedDatelong  The point in time the search domain was marked for deletion.
descriptionstring  A description of the repository.
effectiveCachePolicyCachePolicyyes The effective cache policy that will apply to the repository, organization or global default, in order of precedence is: the repository cache policy, if set; the organization cache policy, if set; the global cache policy, if set; or the default cache policy in which no segments are prioritized. Cache policies are a limited feature and subject to change. See CachePolicy.
eventForwardersForSelection[EventForwarderForSelection]yes List event forwarders in the organization with only basic information. See EventForwarderForSelection.
eventForwardingRules[EventForwardingRule]yes The event forwarding rules configured for the repository. See EventForwardingRule.
fdrFeedmultipleyes The unique identifier of the FDR feed to get. The multiple datatype consists of (id: string): FdrFeed. See FdrFeed.
fdrFeedControlmultipleyes Administrator control for an FDR feed. Provide the identifier of the FDR feed the administrator is to control. The maxNodes is the maximum number of nodes with which to poll the FDR feed. This feature is a preview and is still being iterated; changes may occur. The multiple datatype consists of (id: string): FdrFeedControl. See FdrFeedControl.
fdrFeedControls[FdrFeedControl]yes Administrator controls for FDR feeds. This feature is still being iterated; changes may occur. See FdrFeedControl.
fdrFeeds[FdrFeed]yes Saved FDR feeds. See FdrFeed.
fileFieldSearchmultipleyes Searching fields in a file. The multiple datatype consists of (fileName: string, fieldName: string, prefixFilter: string, valueFilters: [FileFieldFilterType], fieldsToInclude: [string], maxEntries: integer): [[DictionaryEntryType]]. See FileFieldFilterType and DictionaryEntryType,
filterAlertmultipleyes A saved filter alert. The multiple datatype consists of (id: string): FilterAlert. See FilterAlert.
filterAlerts[FilterAlert]yes Saved filter alerts. See FilterAlert.
groups[Group]yes Groups with assigned roles. See Group.
hasPackageInstalledmultipleyes Whether the repository has a given package installed. The multiple datatype consists of (packageId: VersionedPackageSpecifier): boolean. VersionedPackageSpecifier is a scalar.
idstringyes The unique identifier of the repository.
ingestBlockdatetime  The date and time in the future after which ingest for this repository will be re-enabled.
ingestFeedmultipleyes A saved Ingest feed. This is a preview not ready for production. The multiple datatype consists of (id: string): IngestFeed. See IngestFeed.
ingestFeedsmultipleyes Saved Ingest feeds. This is a preview and not ready for production. The multiple datatype consists of (searchFilter: string, typeFilter: [IngestFeeds__Type!], sortBy: IngestFeeds__SortBy, orderBy: OrderBy, skip: integer, limit: integer): IngestFeedQueryResultSet!). See IngestFeedQueryResultSet.
ingestListeners[IngestListener]yes The ingest listeners configured for this repository (see IngestListener Table).
ingestSizeBasedRetentionfloat  Retention in gigabytes, based on the size of data when it arrives at LogScale, before parsing and compression. LogScale will keep at most this amount of data.
ingestTokens[IngestToken]yes The ingest token used for receiving data into the repository. See IngestToken.
installedPackages[PackageInstallation]yes List packages installed on a specific view or repository. See PackageInstallation.
isActionAllowedmultipleyes Check if the current user is allowed to perform the given action on the view. The multiple datatype consists of (action: ViewAction): boolean. See ViewAction.
isStarredbooleanyes Whether the repository is marked with a star.
interactions[ViewInteraction]yes All interactions defined on the view. See ViewInteraction.
limitLimitV2  This is the limit attached to the repository. See LimitV2.
maxAutoShardCountinteger  The maximum number of auto shards created.
nameRepoOrViewNameyes The name of the repository. RepoOrViewName is a scalar.
packageV2multipleyes The returned package information for the specified package. The dataype is (packageId: VersionedPackageSpecifier!): Package2! VersionedPackageSpecifier is a scalar. See Package2.
packageVersionsmultipleyes The available versions of a package. This is a preview and may be moved to the Package2 object. The multiple datatype consists of (packageId: UnversionedPackageSpecifier): [RegistryPackageVersionInfo]. UnversionedPackageSpecifier is a scalar. See RegistryPackageVersionInfo.
parsermultiple  The Parser in the repository. The datatype consists of parser(id: string). This is deprecated. Use instead id.
parsers[Parser]yes List of parsers used with the repository. See Parser.
permanentlyDeletedAtlong  The point in time the search domain will not be restorable anymore.
recentQueriesV2[RecentQuery]yes Any recent queries. See RecentQuery.
reposExcludedInSearchLimit[string]yes Repositories not part of the search limitation.
s3ArchivingConfigurationS3Configuration  The configuration for S3 archiving (e.g., bucket name and region). See S3Configuration.
savedQueries[SavedQuery]yes Saved queries. See SavedQuery.
savedQuerymultipleyes A saved query. The multiple datatype consists of (id: string!): SavedQuery. See SavedQuery.
searchLimitedMslong  Search limit in milliseconds, to which searches should are limited.
scheduledReportmultipleyes Saved scheduled report. The multiple datatype consists of (id: string): ScheduledReport. See ScheduledReport.
scheduledReports[ScheduledReport]yes Saved scheduled reports. See ScheduledReport.
scheduledSearchmultipleyes A saved scheduled search. The multiple datatype consists of (id: string): ScheduledSearch. See ScheduledSearch.
scheduledSearches[ScheduledSearch]yes Saved scheduled searches. See ScheduledSearch.
starredFields[string]yes A list of fields which are marked with a star in the repository.
storageSizeBasedRetentionfloat  Retention in gigabytes, based on the size of data when in storage, after parsing and compression. LogScale will keep at least this amount of data, but as close to this amount as possible.
tags[string]yes All tags from all datasources.
timeBasedBackupRetentionfloat  Sets time in days to keep back-ups before they are deleted.
timeBasedRetentionfloat  The maximum time in days to keep data. Older date will be deleted.
timeOfLatestIngestdatetime  The timestamp of the latest ingested data, or null if the repository is empty.
typeRepositoryTypeyes Repository Types are used for tracking trial status in LogScale Cloud setups. See RepositoryType.
uncompressedByteSizelongyes Total size the data, measured as the size stored before compression and is thus the size of the internal format, not the data that was ingested.
uncompressedByteSizeOfMergedlongyes Total size the data, merged parts. Size is measured as the size stored before compression and is thus the size of the internal format, not the data that was ingested.
usageTagstring  The usage tag used to group usage summary on repositories.
users[User]yes Users who have access to the repository. See User.
usersAndGroupsmultipleyes Users or groups who have access to the repository. The multiple datatype consists of (search: string, skip: integer, limit: integer): UsersAndGroupsSearchResultSet See UsersAndGroupsSearchResultSet.
usersV2multipleyes Used to search for a user based on search parameters and for a given permission. The multiple datatype consists of (search: string, permissionFilter: Permission, skip: integer, limit: integer): Users!. See Permission and Users.
viewerQueryPrefixstringyes The query prefix prepended to each search in this domain.