Summary

The starredDashboards() GraphQL query returns a list of starred dashboards.

Syntax

graphql
starredDashboards(): [Dashboard!]!

There is no input for this query field. Returns a non-nullable [Dashboard!]! array. The table below lists all fields.

Example

Raw
graphql
query {
	starredDashboards {
	  searchDomain { id, name },
      id, name, 
      widgets { id, title, description }
	}
}
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 {
	starredDashboards {
	  searchDomain { id, name },
      id, name, 
      widgets { id, title, description }
	}
}"
}
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 {
	starredDashboards {
	  searchDomain { id, name },
      id, name, 
      widgets { id, title, description }
	}
}"
}
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 { ^
	starredDashboards { ^
	  searchDomain { id, name }, ^
      id, name,  ^
      widgets { id, title, description } ^
	} ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "query {
	starredDashboards {
	  searchDomain { id, name },
      id, name, 
      widgets { id, title, description }
	}
}"
}'
    "$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 = "query {
	starredDashboards {
	  searchDomain { id, name },
      id, name, 
      widgets { id, title, description }
	}
}";
$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" : "query {
	starredDashboards {
	  searchDomain { id, name },
      id, name, 
      widgets { id, title, description }
	}
}"
}'''

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 {
	starredDashboards {
	  searchDomain { id, name },
      id, name, 
      widgets { id, title, description }
	}
}"
}
);


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": {
    "starredDashboards": [
      {
        "searchDomain": {
          "id": "abc123",
          "name": "humio"
        },
        "id": "def456",
        "name": "Errors",
        "widgets": [
          {
            "id": "ghi789",
            "title": "Standard Alerts With Other Errors",
            "description": "Standard alerts with errors not from invoking actions."
          },
          {
            "id": "jkl012",
            "title": "Slow Warnings",
            "description": null
          }
        ]
      }
    ]
  }
}

In the example here, it requests information on all dashboards that have been starred. First, the id and name is requested on the search domain for each starred dashboard. In this case, since there is only one starred dashboard, there is only one search domain — and information on that one dashboard.

Next, the id, name, and a list of widgets is requested. For each widget, the id, title, and description of each of those. This is all done with nesting of parameters with commas and curly-brackets.

Returned Values

Returns a non-nullable [Dashboard!]! array. The table below lists all fields:

Table: Dashboard Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
allowedActionsAssetActionyes Short-Term Allowed asset actions
createdInfoAssetCommitMetadata  Long-Term Metadata related to the creation of the dashboard
defaultFilterDashboardFilter  Long-Term  
defaultSharedTimeEnabledBooleanyes Long-Term  
defaultSharedTimeEndStringyes Long-Term  
defaultSharedTimeStartStringyes Long-Term  
descriptionString  Long-Term  
displayNameStringyes Long-Term  
filtersDashboardFilteryes Long-Term  
idStringyes Long-Term  
isStarredBooleanyes Long-Term  
labelsStringyes Long-Term  
modifiedInfoAssetCommitMetadata  Long-Term Metadata related to the latest modification of the dashboard
nameStringyes Long-Term  
packagePackageInstallation  Long-Term  
packageIdVersionedPackageSpecifier  Long-Term  
parametersDashboardParameteryes Long-Term  
readOnlyTokensDashboardLinkyes Long-Term  
resourceStringyes Short-Term The resource identifier for this dashboard.
searchDomainSearchDomainyes Long-Term  
sectionsSectionyes Long-Term  
seriesSeriesConfigyes Long-Term  
seriesColorPaletteString  Short-Term  
templateYamlStringyes  deprecated in 1.225A YAML formatted string that describes the dashboard. It does not contain links or permissions, and is safe to share and use for making copies of a dashboard.
timeJumpSizeInMsInt  Long-Term  
updateFrequencyDashboardUpdateFrequencyTypeyes Long-Term  
widgetsWidgetyes Long-Term  
yamlTemplateYAMLyes Long-Term A YAML formatted string that describes the dashboard. It does not contain links or permissions, and is safe to share and use for making copies of a dashboard.