- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization scopes
- Try it!
Creates a sink that exports specified log entries to a destination. The export begins upon ingress, unless the sink's writerIdentity
is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.
HTTP request
POST https://logging.googleapis.com/v2/{parent=folders/*}/sinks
The URL uses gRPC Transcoding syntax.
Path parameters
parent
string
Required. The resource in which to create the sink:
"projects/[PROJECT_ID]"
"organizations/[ORGANIZATION_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]"
"folders/[FOLDER_ID]"
For examples:
"projects/my-project"
"organizations/123456789"
Authorization requires the following IAM
permission on the specified resource parent
:
-
logging.sinks.create
Query parameters
| Parameters | |
|---|---|
uniqueWriterIdentity
|
Optional. Determines the kind of IAM identity returned as If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of |
customWriterIdentity
|
Optional. The service account provided by the caller that will be used to write the log entries. The format must be |
Request body
The request body contains an instance of LogSink
.
Response body
If successful, the response body contains a newly created instance of LogSink
.
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 the Authentication Overview .

