Retrieve logs for a time range.
Retrieve logs starting at the from
time, optionally
filtered by to
, machine
, instance
, and version
.
You will receive at most 100 log entries (each consisting of potentially multiple lines) but you may receive fewer entries due to various partitioning schemes.
You may retry the call by specifying the returned maxTimestamp
as the new from
time to retrieve additional logs.
Query parameters
-
The ISO-8601 timestamp of the earilest-timestamped log to retrieve
-
to string(date-time)
The ISO-8601 timestamp of the latest-timestamped log to retrieve
-
machine string
The name of the machine to retrieve logs for
Minimum length is
1
. Format should match the following pattern:^[a-zA-Z0-9_-]{1,128}$
. -
instance string
The name of the machine instance to retrieve logs for
Minimum length is
1
. Format should match the following pattern:^[a-zA-Z0-9_-]{1,128}$
. -
version string
The id of the machine version to retrieve logs for
curl \
-X GET https://api.statebacked.dev/logs?from=2023-05-04T09%3A42%3A00%2B00%3A00 \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"maxTimestamp": "2023-05-04T09:42:00+00:00",
"logs": [
{
"timestamp": "2023-05-04T09:42:00+00:00",
"orgId": "string",
"machineName": "my-machine",
"instanceName": "user-1234",
"machineVersionId": "string",
"outputType": "stdout",
"log": "string"
}
]
}
{
"maxTimestamp": "2024-05-04T09:42:00+00:00",
"logs": [
{
"timestamp": "2024-05-04T09:42:00+00:00",
"orgId": "string",
"machineName": "my-machine",
"instanceName": "user-1234",
"machineVersionId": "string",
"outputType": "stdout",
"log": "string"
}
]
}