Getting information about a log group
- In the management console
, select the folder with the log group. - Select Cloud Logging.
- In the left-hand panel, select
Groups. - Select the log group.
- The Overview page will show the log group details.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can also set a different folder for any specific command using the --folder-name
or --folder-id
parameter.
To find out the ID or name of a log group, get a list of groups in the folder.
To get information about a log group, run this command:
yc logging group get <group_name>
Result:
id: e23fal6r2l9d********
folder_id: b1gmit33ngp3********
cloud_id: b1gia87mbaom********
created_at: "2023-09-20T18:57:19.903Z"
name: default
description: log-group description
labels:
compute: instance-logging
vpc: vpc-log
status: ACTIVE
retention_period: 3600s
data_stream: /ru-central1/b1gia87mbaom********/etnu60k6l8ft********/sample-stream
To get log group details, use the get REST API method for the LogGroup resource or the LogGroupService/Get gRPC API call.
To get log group statistics, use the stats REST API method for the LogGroup resource or the LogGroupService/Stats gRPC API call.
Request examples
The examples below use grpcurl
. To run them, authenticate with the API and clone the cloudapi
To get log group details, send the following request:
grpcurl \
-rpc-header "Authorization: Bearer $(yc iam create-token)" \
-d '{"log_group_id": "<log_group_ID>"}' \
-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.Get
Result:
{
"id": "e23u2vn449av********",
"folderId": "b1g3f9i71bpm********",
"cloudId": "b1gvlrnlei4l********",
"createdAt": "2023-11-15T12:48:46.321Z",
"name": "default",
"description": "Auto-created default group",
"status": "ACTIVE",
"retentionPeriod": "259200s"
}
To get log group statistics, send this request:
grpcurl \
-rpc-header "Authorization: Bearer $(yc iam create-token)" \
-d '{"log_group_id": "<log_group_ID>"}' \
-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.Stats
Result:
{
"logGroupId": "e23u2vn449av********",
"bytes": "73510",
"records": "158"
}