Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Cloud Logging
  • Getting started
    • All guides
    • Adding records
    • Reading records
    • Managing rights to access log groups
      • Creating a log group
      • Updating a log group
      • Viewing monitoring charts
      • Deleting a log group
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • FAQ
  1. Step-by-step guides
  2. Managing a log group
  3. Creating a log group

Creating a log group

Written by
Yandex Cloud
Improved by
Danila N.
Updated at May 5, 2025
Management console
CLI
Terraform
API
  1. In the management console, select the folder where you want to create your log group.

  2. Select Cloud Logging.

  3. Click Create group.

  4. (Optional) Enter a name and description for the log group. Use the following name format:

    • It must be from 2 to 63 characters long.
    • It may contain lowercase Latin letters, numbers, and hyphens.
    • It must start with a letter and cannot end with a hyphen.
  5. Set the log group record retention period.

  6. (Optional) Select a data stream or create a new one to redirect records added to the log group to.

  7. Click Create group.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To create a log group, run this command:

yc logging group create \
  --name=group \
  --retention-period=1h \
  --data-stream=<stream_ID>

Where:

  • --name: Log group name.

  • --retention-period: Retention period for log group records. This is an optional parameter.

    The record retention period can only be specified in hours, minutes, or seconds. For example, 1h or 1440m.

  • --data-stream: Yandex Data Streams data stream ID. This is an optional parameter. Records added to the log group will be automatically redirected to the specified stream. A stream ID consists of an availability zone, folder ID, Yandex Managed Service for YDB database ID, and stream name.

    For example, your stream ID will appear as /ru-central1/aoeu1kuk2dht********/cc8029jgtuab********/aws_stream if:

    • aws_stream: Stream name.
    • ru-central1: Availability zone.
    • aoeu1kuk2dht********: Folder ID.
    • cc8029jgtuab********: Yandex Managed Service for YDB database ID.

Result:

done (1s)
id: af3flf29t8**********
folder_id: aoek6qrs8t**********
cloud_id: aoegtvhtp8**********
created_at: "2023-06-24T09:56:38.970Z"
name: group
status: ACTIVE
retention_period: 3600s
data_stream: /ru-central1/aoeu1kuk2dht********/cc8029jgtuab********/aws_stream

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the documentation on the Terraform website or mirror website.

If you do not have Terraform yet, install it and configure its Yandex Cloud provider.

  1. In the configuration file, define the parameters of the resources you want to create:

    • name: Log group name. This is an optional parameter. Use the following name format:

      • It must be from 2 to 63 characters long.
      • It may contain lowercase Latin letters, numbers, and hyphens.
      • It must start with a letter and cannot end with a hyphen.
    • folder_id: Folder ID. This is an optional parameter. By default, the value specified in the provider settings is used.

    • retention_period: Retention period for log group records. This is an optional parameter.

      The record retention period can only be specified in hours, minutes, or seconds. For example, 1h or 1440m.

    Here is the configuration file example:

    provider "yandex" {
      token     = "<OAuth_token>"
      cloud_id  = "<cloud_ID>"
      folder_id = "<folder_ID>"
      zone      = "ru-central1-a"
    }
    
    resource "yandex_logging_group" "group1" {
      name             = "<log_group_name>"
      folder_id        = "<folder_ID>"
      retention_period = "5h"
    }
    

    For more information about the yandex_logging_group parameters in Terraform, see the relevant Terraform article.

  2. Make sure the configuration files are correct.

    1. In the command line, go to the directory where you created the configuration file.

    2. Run a check using this command:

      terraform plan
      

    If you described the configuration correctly, the terminal will display a list of the resources being created and their parameters. If the configuration contains any errors, Terraform will point them out.

  3. Deploy the cloud resources.

    1. If the configuration does not contain any errors, run this command:

      terraform apply
      
    2. When asked to confirm the changes, type yes and press Enter.

    Terraform will create your resources in the specified folder. You can check the new resources and their settings using the management console or this CLI command:

    yc logging group list
    

To create a log group, use the create REST API method for the LogGroup resource or the LogGroupService/Create gRPC API call.

Request example

The example below uses the grpcurl utility. To use the example, authenticate in the API and clone the cloudapi repository.

Create a file named payload.json:

{
   "folder_id": "<folder_ID>",
   "name": "new-group",
   "description": "Description of a log group created using grpcurl",
   "labels": {
     "compute": "instance-logging"
   }
}

Run this request:

grpcurl -rpc-header "Authorization: Bearer $(yc iam create-token)" \
  -d @ \
  -import-path ~/cloudapi/ \
  -import-path ~/cloudapi/third_party/googleapis/ \
  -proto ~/cloudapi/yandex/cloud/logging/v1/log_group_service.proto \
logging.api.cloud.yandex.net:443 yandex.cloud.logging.v1.LogGroupService.Create < payload.json

Response:

{
  "id": "e23nitus5cg9********",
  "description": "Create log group",
  "createdAt": "2023-11-23T14:54:23.077532292Z",
  "createdBy": "ajeugsk5ubk6********",
  "modifiedAt": "2023-11-23T14:54:23.077532292Z",
  "metadata": {
    "@type": "type.googleapis.com/yandex.cloud.logging.v1.CreateLogGroupMetadata",
    "logGroupId": "e23pjn86385t********"
  }
}

Was the article helpful?

Previous
Getting information about a log group
Next
Updating a log group
© 2025 Direct Cursus Technology L.L.C.