Creating a log sink
Written by
Updated at October 17, 2024
Management console
CLI
API
-
In the management console
, select the folder where you want to create your log sink. -
Select Cloud Logging.
-
Go to the Sinks tab.
-
Click Create sink.
-
(Optional) Enter a sink name and description. The name format is as follows:
- The name must be from 3 to 63 characters long.
- It may contain lowercase Latin letters, numbers, and hyphens.
- The first character must be a letter and the last character cannot be a hyphen.
-
(Optional) Add labels.
-
In the Destination field, select
Object Storage
. -
Select the bucket to save logs to.
-
(Optional) Specify a folder.
-
Select a service account authorized to upload objects to the bucket.
-
Click Create sink.
To create a log sink, run the following command:
yc logging sink create \
--name <sink_name> \
--service-account-id <service_account_ID> \
--s3 bucket=<bucket_name>
Where:
--name
: Log sink name. This is an optional parameter.--service-account-id
: ID of the service account authorized to upload objects to the bucket.bucket
: Name of the bucket to upload logs to.
Result:
id: e23s5s2jsr78********
folder_id: b1gc1t4cb638********
cloud_id: b1gvlrnlei4l********
created_at: "2023-09-24T19:05:33.367058291Z"
name: test
service_account_id: aje07l4q4vmo********
s3:
bucket: bucket-name
To create a log sink, use the create REST API method for the Sink resource or the SinkService/Create gRPC API call.