Rather than delete a dashboard filter and create a new one, you can use the updateDashboardFilter() GraphQL mutation to update a dashboard filter.

You might need more dashboard filters. To add them, use the addDashboardFilter() mutation. To set one as the default, use setDefaultDashboardFilter(). If you want to delete a dashboard filter, use removeDashboardFilter().

You can change dashboard filters through the UI, if you don't want to use the GraphQL API to do this. Go to the Apply Dashboard Filters page in the main documentation for more on this.

Hide Query Example

Show Dashboard Filters Query

For more information on dashboards in general, see the Dashboards documentation page. You may also want to look at the Query Filters reference page.

API Stability Long-Term

Syntax

graphql
updateDashboardFilter(
     id: string!,
     filterId: string!,
     name: string!,
     prefixFilter: string!
   ): Dashboard!

You'll have to give the unique identifiers of the dashboard and the filter you want to update. Click on Show Query below to find these identifiers. You might also give a new name and prefix filter. See the Given Datatype section for details on the input parameters.

For the results, you can get plenty related to the dashboard, including a list of filters in use. See the Returned Datatype section for more choices.

Hide Query Example

Show Filter Identifiers Query

Example

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

Given Datatype

For the input, you would need to provide the unique identifiers of the dashboard and filter. You can also give the name of the filter and the prefix. Click on Show Query link in the Syntax section to find the dashboard and filter identifiers.

Table: Input Using Standard Datatypes

Parameter Type Required Default Description
filterId string yes   The unique identifier of the filter.
id string yes   The unique identifier of the dashboard.
name string yes   The name of the filter.
prefixFilter string yes   The text on which to filter values by prefix of dashboard widgets.

Returned Datatype

For the returned datatype, there are several parameters related to the dashboard. The table below lists them. For this mutation you will probably be most interested in the filters parameter and the link to its datatype to get a list of all of the dashboard filters in use.

Table: Dashboard

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For return datatypes, this indicates that you must specify which fields you want returned in the results.
Table last updated: Aug 19, 2025
allowedActions[AssetAction]yes Short-TermThe allowed asset actions. See AssetAction Table). This is feature is a preview and may be changed.
createdInfoAssetCommitMetadata  Long-TermMetadata related to the creation of the dashboard. See AssetCommitMetadata.
defaultFilterDashboardFilter  Long-TermThe default filter used with the dashboard (see DashboardFilter Table).
defaultSharedTimeEnabledbooleanyes Long-TermWhether the shared time by default is enabled.
defaultSharedTimeEndstringyes Long-TermThe default shared ending time.
defaultSharedTimeStartstringyes Long-TermThe default shared starting time.
descriptionstring  Long-TermA description of the dashboard.
displayNamestringyes Long-TermThe display name of the dashboard.
filters[DashboardFilter]yes Long-TermThe filters used with the dashboard. See DashboardFilter.
idstringyes Long-TermThe unique identifier for the dashboard.
isStarredbooleanyes Long-TermWhether the dashboard is marked with a star.
labels[string]yes Long-TermAny labels associated with the dashboard.
modifiedInfoAssetCommitMetadata  Long-TermMetadata related to the latest modification of the dashboard. See AssetCommitMetadata.
namestringyes Long-TermThe name of the dashboard.
packagePackageInstallationyes Long-TermThe package, if there is one, in which the dashboard is included (see PackageInstallation Table).
packageIdVersionedPackageSpecifieryes Long-TermThe unique identifiers of the package. VersionedPackageSpecifier is a scalar.
parameters[DashboardParameter]yes Long-TermList of dashboard parameters (see DashboardParameter Table).
readOnlyTokens[DashboardLink]yes Long-TermList of tokens used to access the dashboard without logging in. Useful for wall mounted dashboards or public dashboards. See DashboardLink.
resourcestringyes Short-TermThe resource identifier for this dashboard.
searchDomainSearchDomainyes Long-TermThe search domain for the dashboard. See SearchDomain.
sections[Section]yes Long-TermThe sections for the dashboard. See Section.
series[SeriesConfig]yes Long-TermThe series configuration for the dashboard. See SeriesConfig.
templateYamlstringyes DeprecatedA yaml formatted string that describes the dashboard. This field has been replaced with yamlTemplate. It will be removed at the earliest in version 1.225.
timeJumpSizeInMsinteger  Long-TermThe skip time in milliseconds for the dashboard.
updateFrequencyDashboardUpdateFrequencyTypeyes Long-TermThe frequency in which dashboard is updated. See DashboardUpdateFrequencyType, and the explanations under the DashboardParameter.
widgets[Widget]yes Long-TermWidgets for the dashboard (see Widget Table).
yamlTemplateYAMLyes Long-TermA yaml formatted string that describes the dashboard. YAML is a scalar. It doesn't contain links or permissions, and is safe to share and use for making copies of a dashboard. This replaced templateYaml starting in LogScale version 1.165.