gcloud logging sinks update

NAME
gcloud logging sinks update - update a sink
SYNOPSIS
gcloud logging sinks updateSINK_NAME[DESTINATION][--add-exclusion=[description=DESCRIPTION],[disabled=DISABLED],[filter=FILTER],[name=NAME]][--clear-exclusions][--custom-writer-identity=SERVICE_ACCOUNT_EMAIL][--description=DESCRIPTION][--disabled][--include-children][--intercept-children][--log-filter=LOG_FILTER][--remove-exclusions=[EXCLUSIONID,…]][--update-exclusion=[description=DESCRIPTION],[disabled=DISABLED],[filter=FILTER],[name=NAME]][--use-partitioned-tables][--billing-account=BILLING_ACCOUNT_ID    |--folder=FOLDER_ID    |--organization=ORGANIZATION_ID    |--project=PROJECT_ID][GCLOUD_WIDE_FLAG]
DESCRIPTION
Change the[DESTINATION] or--log-filter associatedwith a sink. The new destination must already exist and Cloud Logging must havepermission to write to it.

Log entries are exported to the new destination immediately.

EXAMPLES
To only update a sink filter, run:
gcloudloggingsinksupdatemy-sink--log-filter='severity>=ERROR'

Detailed information about filters can be found at:https://cloud.google.com/logging/docs/view/logging-query-language

POSITIONAL ARGUMENTS
SINK_NAME
The name of the sink to update.
[DESTINATION]
A new destination for the sink. If omitted, the sink's existing destination isunchanged.
FLAGS
--add-exclusion=[description=DESCRIPTION],[disabled=DISABLED],[filter=FILTER],[name=NAME]
Add an exclusion filter for log entries that are not to be routed to the sink'destination. This flag can be repeated.

Thename andfilter attributes are required. Thefollowing keys are accepted:

name
Required. An identifier, such asload-balancer-exclusion. Identifiers arelimited to 100 characters and can include only letters, digits, underscores,hyphens, and periods.
description
Optional. A description of this exclusion.
filter
Required. Entries that match this advanced log filter will be excluded. Filtercannot be empty.
disabled
Optional. By default, an exclusion is not disabled. To disable an exclusion,include this key and specify any value.
--clear-exclusions
Remove all logging exclusions from the sink.
--custom-writer-identity=SERVICE_ACCOUNT_EMAIL
Writer identity for the sink. This flag can only be used if the destination is alog bucket in a different project. The writer identity is automaticallygenerated when it is not provided for a sink.
--description=DESCRIPTION
Description of the sink.
--disabled
Disable the sink. Disabled sinks do not route logs to the sink destination.Specify --no-disabled to enable a disabled sink. If this flag is not specified,the value will not be updated.
--include-children
Whether to export logs from all child projects and folders. Only applies tosinks for organizations and folders.
--intercept-children
Whether to intercept logs from all child projects and folders. Only applies tosinks for organizations and folders.
--log-filter=LOG_FILTER
A new filter expression for the sink. If omitted, the sink's existing filter (ifany) is unchanged.
--remove-exclusions=[EXCLUSIONID,…]
Specify the name of the Logging exclusion(s) to delete.
--update-exclusion=[description=DESCRIPTION],[disabled=DISABLED],[filter=FILTER],[name=NAME]
Update an exclusion filter for a log entry that is not to be exported. This flagcan be repeated.

Thename attribute is required. Thefollowing keys are accepted:

name
Required. An identifier, such asload-balancer-exclusion. Identifiers arelimited to 100 characters and can include only letters, digits, underscores,hyphens, and periods.
description
Optional. A description of this exclusion.
filter
Optional. Entries that match this advanced log filter will be excluded. Filtercannot be empty.
disabled
Optional. To disable an exclusion, include this key and specify any value. Toenable a disabled exclusion, include this key, but do not specify any value. Donot include this key unless you want to change its value.
Settings for sink exporting data to BigQuery.
--use-partitioned-tables
If specified, use BigQuery's partitioned tables. By default, Logging createsdated tables based on the log entries' timestamps, e.g. 'syslog_20170523'.Partitioned tables remove the suffix and special query syntax(https://cloud.google.com/bigquery/docs/querying-partitioned-tables) must beused.
At most one of these can be specified:
--billing-account=BILLING_ACCOUNT_ID
Billing account of the sink to update.
--folder=FOLDER_ID
Folder of the sink to update.
--organization=ORGANIZATION_ID
Organization of the sink to update.
--project=PROJECT_ID
Project of the sink to update.

The Google Cloud project ID to use for this invocation. If omitted, then thecurrent project is assumed; the current project can be listed usinggcloudconfig list --format='text(core.project)' and can be set usinggcloud config set project PROJECTID.

--project and its fallbackcore/project property playtwo roles in the invocation. It specifies the project of the resource to operateon. It also specifies the project for API enablement check, quota, and billing.To specify a different project for quota and billing, use--billing-project orbilling/quota_project property.

GCLOUD WIDE FLAGS
These flags are available to all commands:--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.

Run$gcloud help for details.

NOTES
These variants are also available:
gcloudalphaloggingsinksupdate
gcloudbetaloggingsinksupdate

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-01-21 UTC.