Getting a list of log groups
Written by
Updated at November 21, 2024
Management console
CLI
API
- In the management console
, go to the folder where you want to view a list of log groups. - Select Cloud Logging.
- In the left-hand panel, select
Groups.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To get a list of log groups in the folder, run the command:
yc logging group list
Result:
+----------------------+---------+----------------------+--------+
| ID | NAME | FOLDER ID | STATUS |
+----------------------+---------+----------------------+--------+
| af36gk8qv2********** | default | aoek6qrs8t********** | ACTIVE |
+----------------------+---------+----------------------+--------+
To get a list of log groups, use the list REST API method for the LogGroup resource or the LogGroupService/List gRPC API call.
Request example
The example below uses the grpcurl
utility. To use the example, authenticate in the API and clone the cloudapi
Run this request:
grpcurl \
-rpc-header "Authorization: Bearer $(yc iam create-token)" \
-d '{"folder_id": "<folder_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.List
Result:
{
"groups": [
{
"id": "e23u2vn449av********",
"folderId": "b1g3f9i71bpm********",
"cloudId": "b1gvlrnlei4l********",
"createdAt": "2023-02-09T07:49:15.857Z",
"name": "default",
"description": "Auto-created default group",
"status": "ACTIVE",
"retentionPeriod": "259200s"
}
]
}