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-Tokenheader, or an S3 key; - AWS CLI interface, which allows you to use the Amazon CloudWatch API methods, detailed in the (DescribeLogGroups, DescribeLogStreams, GetLogEvents) and FilterLogEvents articles of the AWS documentation. To get started, configure the AWS CLI;
- of the Fluent Bit plug-in. To get started , configure Fluent Bit;
- Grafana Alloy agent. Set up Grafana Alloy to get started.
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.
-
Open the log group page.
-
Select Stream.
-
Optional: filter the 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=<log_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;<log_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 <log_stream_name>
Specify:
<log_group_name>— log group name, e.g.s/lbaas/Bellatrix-lb;<log_stream_name>— event stream name, e.g.http-b964dde5-7080-4169-8f9e-127bd59c89ca.
Filter 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.
-
Open the log group page.
-
Select Stream.
-
In the search box, enter the value that the events contain. You can use a filter pattern for unstructured log events.For more information, see Using filter patterns to match terms in unstructured log events AWS documentation.
Examples of values in the search box and search results from the filter pattern:
errors— events that containerror;error timeout— events that containerrorandtimeout;?500 ?404— will display events that contain500or404;error -timeout— events that containerrorbut 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 -XPOST \
-H 'X-Auth-Token: <x_auth_token>' \
-H 'Content-Type: application/json' \
-d '{"logGroupName": "<log_group_name>", "logStreamNames": ["<log_stream_name>"], "filterPattern": "<filter>"}' \
'https://<pool>.logs.selcloud.ru/v1/events/filter'
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;<log_stream_name>— event stream name, e.g.http-b964dde5-7080-4169-8f9e-127bd59c89ca;<filter>— the value that the events contain, e.g.timeout.
Example answer:
{
"events": [
{
"eventId": "69f3e0eb-9562-4276-a323-3a2fa9cbd92c",
"ingestionTime": 1760097303090,
"logStreamName": "http-b964dde5-7080-4169-8f9e-127bd59c89ca",
"message": "backend connection timeout after 5000ms",
"timestamp": 1760097244000
},
{
"eventId": "d1afcc5c-3558-4e7a-b8c5-d90622ff248b",
"ingestionTime": 1760097326874,
"logStreamName": "http-b964dde5-7080-4169-8f9e-127bd59c89ca",
"message": "backend connection timeout after 5000ms",
"timestamp": 1760097244000
}
]
}
Execute the command:
aws logs filter-log-events --log-group-name <log_group_name> --log-stream-name <log_stream_name> --filter-pattern <filter>
Specify:
<log_group_name>— log group name, e.g.s/lbaas/Bellatrix-lb;<log_stream_name>— event stream name, e.g.http-b964dde5-7080-4169-8f9e-127bd59c89ca;<filter>— the value that the events contain, e.g.timeout.