Get the logs
You can only retrieve logs for balancers and cloud database clusters for which logging is enabled.
You can:
Logs can be retrieved using:
- control panel;
- Cloud Logging API methods. You can authorize using an IAM token for the project, which is passed in each request in the
X-Auth-Token
header, or an S3 key; - AWS CLI interface that implements the Amazon CloudWatch API methods, detailed in the AWS documentation (DescribeLogGroups, DescribeLogStreams, and GetLogEvents). To get started , configure it;
- of the Fluent Bit plug-in.
The address (URL) can be viewed in the URL list.
Get a list of log groups
Control panel
API
AWS CLI
Execute the request:
curl -i \
-H 'X-Auth-Token: <x_auth_token>' \
'https://<pool>.logs.selcloud.ru/v1/groups?limit=50'
Specify:
<x_auth_token>
— IAM token for the project;<pool>
— pool which contains logs, for exampleru-8
. Address (URL) depends on the region and pool, you can see in the URL list.
If there are no log groups, you will get an answer:
{"groups":[]}
If there are log groups, you will get a response as a list in JSON format.Example response:
{
"groups": [
{
"name": "s/lbaas/Bellatrix-lb",
"created_at": 1742663023757
},
{
"name": "group-name",
"created_at": 1738779717218
},
{
"name": "s/lbaas/test-lb-for-logs",
"created_at": 1743073180613
}
]
}
Execute the command:
aws logs describe-log-groups
Get a list of event streams
Control panel
API
AWS CLI
Execute the request:
curl -i \
-H 'X-Auth-Token: <x_auth_token>' \
'https://<pool>.logs.selcloud.ru/v1/streams?group=<log_group_name>&sort=asc'
Specify:
<x_auth_token>
— IAM token for the project;<pool>
— pool which contains logs, for exampleru-8
. Address (URL) depends on the region and pool, you can look in the URL list;<log_group_name>
— log group name, e.g.s/lbaas/Bellatrix-lb
.
Example answer:
{"streams":[{"name":"http-b964dde5-7080-4169-8f9e-127bd59c89ca","created_at":1742663023793}]}
Execute the command:
aws logs describe-log-streams --log-group-name <log_group_name>
Specify <log_group_name>
— log group name, for example s/lbaas/Bellatrix-lb
.
Get events
Control panel
API
AWS CLI
-
In the dashboard, on the top menu, click Products and select Logs.
-
Go to the Logs section.
-
Optional: select the product of the log group.
-
Go to the log group page.
-
Select Stream.
-
In the search box, enter the value that the events should contain. You can use a filter pattern for unstructured log events.For more information, see the Using filter patterns to match terms in unstructured log events AWS documentation.
Examples of values in the search box and search results by filter pattern:
errors
— events that containerror
;error timeout
— events that containerror
иtimeout
;?500 ?404
— will display events that contain500
or404
;error -timeout
— events that containerror
but do not containtimeout
;"internal server error"
— events with an exact match of the value will be output.
-
Optional: select UTC Time or Local Time for the displayed event time.
-
Specify a time period to filter events.
Example of a query to retrieve 10 events:
curl -i \
-H 'X-Auth-Token: <x_auth_token>' \
'https://<pool>.logs.selcloud.ru/v1/events?group=<log_group_name>&stream=<stream_name>&sort=desc&limit=10'
Specify:
<x_auth_token>
— IAM token for the project;<pool>
— pool which contains logs, for exampleru-8
. Address (URL) depends on the region and pool, you can look in the URL list;<log_group_name>
— log group name, e.g.s/lbaas/Bellatrix-lb
;<stream_name>
— event stream name, e.g.http-b964dde5-7080-4169-8f9e-127bd59c89ca
.
Example answer:
{
"events": [
{
"id": "6b050a98-8810-4832-b0fe-aee56e34b682",
"ingestion": 1742920694862,
"message": "{\"loadbalancer_id\":\"b964dde5-7080-4169-8f9e-127bd59c89ca\",\"client\":\"10.10.10.10:61076\",\"server_queue\":\"0\",\"backend\":\"0c7498bf-e053-43a8-ba19-4550c9d9904d:3ae8b472-d305-4ef0-8093-d43c87bc3646\",\"bytes_out\":\"354\",\"backend_connections\":\"0\",\"destination\":\"192.168.0.18:80\",\"bytest_in\":\"991\",\"termination_state\":\"--\",\"server\":\"ac64ca54-952f-4881-8a54-6ff77baa1e91\",\"frontend_connections\":\"1\",\"backend_queue\":\"0\",\"elapsed\":\"4\",\"frontend\":\"3ae8b472-d305-4ef0-8093-d43c87bc3646\",\"server_connections\":\"0\"}",
"timestamp": 1742920687071
},
{
"id": "687feab8-6eb9-4ef1-95ed-92259b6bce4a",
"ingestion": 1742920697233,
"message": "{\"loadbalancer_id\":\"b964dde5-7080-4169-8f9e-127bd59c89ca\",\"client\":\"10.10.10.10:61076\",\"server_queue\":\"0\",\"backend\":\"0c7498bf-e053-43a8-ba19-4550c9d9904d:3ae8b472-d305-4ef0-8093-d43c87bc3646\",\"bytes_out\":\"413\",\"backend_connections\":\"0\",\"destination\":\"192.168.0.18:80\",\"bytest_in\":\"1039\",\"termination_state\":\"--\",\"server\":\"ac64ca54-952f-4881-8a54-6ff77baa1e91\",\"frontend_connections\":\"1\",\"backend_queue\":\"0\",\"elapsed\":\"9\",\"frontend\":\"3ae8b472-d305-4ef0-8093-d43c87bc3646\",\"server_connections\":\"0\"}",
"timestamp": 1742920687061
},
{
"id": "63a9fac7-f68e-4540-8419-55e9ef7d426f",
"ingestion": 1742920615179,
"message": "{\"loadbalancer_id\":\"b964dde5-7080-4169-8f9e-127bd59c89ca\",\"client\":\"10.10.10.10:61074\",\"server_queue\":\"0\",\"backend\":\"0c7498bf-e053-43a8-ba19-4550c9d9904d:3ae8b472-d305-4ef0-8093-d43c87bc3646\",\"bytes_out\":\"78\",\"backend_connections\":\"0\",\"destination\":\"192.168.0.18:80\",\"bytest_in\":\"680\",\"termination_state\":\"--\",\"server\":\"ac64ca54-952f-4881-8a54-6ff77baa1e91\",\"frontend_connections\":\"1\",\"backend_queue\":\"0\",\"elapsed\":\"3\",\"frontend\":\"3ae8b472-d305-4ef0-8093-d43c87bc3646\",\"server_connections\":\"0\"}",
"timestamp": 1742920605822
},
{
"id": "a684a2c7-4d3a-4d78-8bdf-d61ab45ce723",
"ingestion": 1742918217458,
"message": "{\"loadbalancer_id\":\"b964dde5-7080-4169-8f9e-127bd59c89ca\",\"client\":\"10.10.10.10:54460\",\"server_queue\":\"0\",\"backend\":\"3ae8b472-d305-4ef0-8093-d43c87bc3646\",\"bytes_out\":\"0\",\"backend_connections\":\"0\",\"destination\":\"-:-\",\"bytest_in\":\"0\",\"termination_state\":\"CR\",\"server\":\"\u003cNOSRV\u003e\",\"frontend_connections\":\"2\",\"backend_queue\":\"0\",\"elapsed\":\"17\",\"frontend\":\"3ae8b472-d305-4ef0-8093-d43c87bc3646\",\"server_connections\":\"0\"}",
"timestamp": 1742918210144
},
{
"id": "d1bf4c22-dee0-424a-a6b5-933c3d2c19f2",
"ingestion": 1742918217458,
"message": "{\"loadbalancer_id\":\"b964dde5-7080-4169-8f9e-127bd59c89ca\",\"client\":\"10.10.10.10:54459\",\"server_queue\":\"0\",\"backend\":\"3ae8b472-d305-4ef0-8093-d43c87bc3646\",\"bytes_out\":\"0\",\"backend_connections\":\"0\",\"destination\":\"-:-\",\"bytest_in\":\"0\",\"termination_state\":\"CR\",\"server\":\"\u003cNOSRV\u003e\",\"frontend_connections\":\"2\",\"backend_queue\":\"0\",\"elapsed\":\"17\",\"frontend\":\"3ae8b472-d305-4ef0-8093-d43c87bc3646\",\"server_connections\":\"0\"}",
"timestamp": 1742918210143
}
],
"pages": {
"next": "1d1bf4c22dee0424aa6b5933c3d2c19f2174291821014300",
"prev": "06b050a9888104832b0feaee56e34b682174292068707100"
}
}
Execute the command:
aws logs get-log-events --log-group-name <log_group_name> --log-stream-name <stream_name>
Specify:
<log_group_name>
— log group name, e.g.s/lbaas/Bellatrix-lb
;<stream_name>
— event stream name, e.g.http-b964dde5-7080-4169-8f9e-127bd59c89ca
.