[Yandex Cloud documentation](../../index.md) > [Yandex Cloud Logging](../index.md) > [Step-by-step guides](index.md) > Log export > Exporting logs > Data Streams

# Exporting logs to Data Streams

{% list tabs group=instructions %}

- Management console {#console}

    1. In the [management console](https://console.yandex.cloud), select the folder with the log group.
    1. [Go](../../console/operations/select-service.md#select-service) to **Cloud Logging**.
    1. Next to the log group, click ![image](../../_assets/console-icons/ellipsis.svg).
    1. In the menu that opens, click **Edit**.
    1. In the **Stream** field, select an existing [data stream](../../data-streams/concepts/glossary.md#stream-concepts) or [create](../../data-streams/operations/manage-streams.md#create-data-stream) a new one.
    1. Click **Save**.

- CLI {#cli}
  
    To export logs to a [data stream](../../data-streams/concepts/glossary.md#stream-concepts), run this command:

    ```bash
    yc logging group update \
      --name=<log_group_name> \
      --data-stream=<stream_ID>
    ```

    Where:
    * `--name`: Log group name.
    * `--data-stream`: Data stream ID in [Yandex Data Streams](../../data-streams/index.md) consisting of the [availability zone](../../overview/concepts/geo-scope.md), [cloud ID](../../resource-manager/operations/cloud/get-id.md), [database](../../ydb/concepts/resources.md#database) ID, and [data stream](../../data-streams/concepts/glossary.md#stream-concepts) name.

    >For example, your stream ID will appear as `/ru-central1/b1gvlrnlei4l********/etn780rpm7e5********/default` if:
     >* `ru-central1`: Region.
     >* `b1gvlrnlei4l********`: Cloud ID.
     >* `etn780rpm7e5********`: YDB database ID.
     >* `default`: Stream name.

- API {#api}

    To export logs to a [data stream](../../data-streams/concepts/glossary.md#stream-concepts), use the [update](../api-ref/LogGroup/update.md) REST API method for the [LogGroup](../api-ref/LogGroup/index.md) resource or the [LogGroupService/Update](../api-ref/grpc/LogGroup/update.md) gRPC API call.

{% endlist %}

The specified data stream will automatically receive the records added to your log group.