Exporting logs to Data Streams
Written by
Updated at October 17, 2024
Management console
CLI
API
- In the management console
, select the folder containing your log group. - Select Cloud Logging.
- In the line with the log group, click
. - In the menu that opens, click Edit.
- In the Stream field, select the existing data stream or create a new one.
- Click Save.
To export logs to a data stream, run this command:
yc logging group update \
--name=<log_group_name> \
--data-stream=<stream_ID>
Where:
--name
: Log group name.--data-stream
: ID of the data stream in Yandex Data Streams consisting of the availability zone, cloud ID, database ID, and data stream name.
For example, your stream ID will appear as /ru-central1/b1gvlrnlei4l********/etn780rpm7e5********/default
if:
ru-central1
: Regionb1gvlrnlei4l********
: Cloud IDetn780rpm7e5********
: YDB database IDdefault
: Stream name
To export logs to a data stream, use the update REST API method for the LogGroup resource or the LogGroupService/Update gRPC API call.
Records added to the log group will be automatically redirected to the specified data stream.