Retrieve logs for a time range.

GET /logs

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

  • from string(date-time) Required

    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

Responses

  • The requested logs.

    Hide response attributes Show response attributes object
    • maxTimestamp string(date-time) Required

      A timestamp

    • logs array[object] Required
      Hide logs attributes Show logs attributes
      • timestamp string(date-time) Required

        A timestamp

      • orgId string Required

        The ID of the organization that owns the machines that produced this log.

      • machineName string Required

        An identifier for the machine definition. Must be unique within your organization.

        Minimum length is 1. Format should match the following pattern: ^[a-zA-Z0-9_-]{1,128}$.

      • instanceName string Required

        An identifier for the machine instance. Must be unique within the instances for the associated machine definition.

        Minimum length is 1. Format should match the following pattern: ^[a-zA-Z0-9_-]{1,128}$.

      • machineVersionId string Required

        The ID of a machine definition version.

      • outputType string Required

        Values are stdout or stderr.

      • log string Required

        Raw log output

GET /logs
curl \
 -X GET https://api.statebacked.dev/logs?from=2023-05-04T09%3A42%3A00%2B00%3A00 \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "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"
    }
  ]
}
Response examples (200)
{
  "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"
    }
  ]
}