Method: projects.sinks.update

Updates a sink. This method replaces the values of thedestination andfilter fields of the existing sink with the corresponding values from the new sink.

The updated sink might also have a newwriterIdentity; see theuniqueWriterIdentity field.

HTTP request

PUT https://logging.googleapis.com/v2/{sinkName=projects/*/sinks/*}

The URL usesgRPC Transcoding syntax.

Path parameters

Parameters
sinkName

string

Required. The full resource name of the sink to update, including the parent resource and the sink identifier:

"projects/[PROJECT_ID]/sinks/[SINK_ID]""organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]""billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]""folders/[FOLDER_ID]/sinks/[SINK_ID]"

For example:

"projects/my-project/sinks/my-sink"

Authorization requires the followingIAM permission on the specified resourcesinkName:

  • logging.sinks.update

Query parameters

Parameters
uniqueWriterIdentity

boolean

Optional. Seesinks.create for a description of this field. When updating a sink, the effect of this field on the value ofwriterIdentity in the updated sink depends on both the old and new values of this field:

  • If the old and new values of this field are both false or both true, then there is no change to the sink'swriterIdentity.
  • If the old value is false and the new value is true, thenwriterIdentity is changed to aservice agent owned by Cloud Logging.
  • It is an error if the old value is true and the new value is set to false or defaulted to false.
customWriterIdentity

string

Optional. The service account provided by the caller that will be used to write the log entries. The format must beserviceAccount:some@email. This field can only be specified when you are routing logs to a log bucket that is in a different project than the sink. When not specified, a Logging service account will automatically be generated.

updateMask

string (FieldMask format)

Optional. Field mask that specifies the fields insink that need an update. A sink field will be overwritten if, and only if, it is in the update mask.name and output only fields cannot be updated.

An emptyupdateMask is temporarily treated as using the following mask for backwards compatibility purposes:

destination,filter,includeChildren

At some point in the future, behavior will be removed and specifying an emptyupdateMask will be an error.

For a detailedFieldMask definition, seehttps://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask

For example:updateMask=filter

This is a comma-separated list of fully qualified names of fields. Example:"user.displayName,photo".

Request body

The request body contains an instance ofLogSink.

Response body

If successful, the response body contains an instance ofLogSink.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see theAuthentication Overview.

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 2025-07-21 UTC.