Skills
Log in

Get logs for a resource

Get logs for any Northflank resource, selected via query parameters: a service, job, or harness (`serviceId`/`jobId`/`harnessId` with `projectId`), an addon including its backups and restores (`addonId` with optional `backupId`/`restoreId`), an OpenTofu job (`opentofuJobId`), a container scan (`containerScanId` with `projectId`), or an unmanaged cluster pod (`clusterId` with `podName`). `logSource` selects between runtime, build, backup and restore logs.

Query parameters

    • projectId

      string
      ID of the project the targeted resource belongs to. Required when targeting a service, job, harness, addon or container scan.
    • clusterId

      string
      ID of the cluster to fetch unmanaged pod logs from. Requires podName and cannot be combined with resource IDs. Does not support deploymentId. The only accepted type is runtime (including repeated values), which does not filter the pod logs.
    • podName

      string
      Name of the pod to fetch logs of. Required when targeting a cluster. Overrides containerName. Not supported for build logs, OpenTofu jobs or container scans.
    • serviceId

      string
      ID of the service to target.
    • jobId

      string
      ID of the job to target.
    • harnessId

      string
      ID of the harness to target.
    • addonId

      string
      ID of the addon to target.
    • containerScanId

      string
      ID of the container scan to target within projectId. Supports runtime logs and time/text filters. Only neutral type=runtime and containerName=all values are accepted, including repeated values. Does not support podName, deploymentId, buildId or runId.
    • backupId

      string
      ID of the addon backup to target. Requires `addonId`.
    • restoreId

      string
      ID of the addon backup restore to target. Requires `backupId`.
    • opentofuJobId

      string
      ID of the OpenTofu job to target. Does not support podName, containerName selectors, deploymentId or type filters.
    • logSource

      string
      Source of the logs to fetch. Defaults to `runtime`, or to the source implied by `backupId`/`restoreId`. `build` is available for services and jobs, `backup` and `restore` for addons. Use `buildId` to select a build; build logs do not support pod or container selectors.
      one of
      runtime, build, backup, restore
    • type

      string
      Type of log. Multiple log types can be selected by specifying the query parameter repeatedly.
      one of
      cdn, mesh, ingress, runtime, build, backup, restore
    • containerName

      (multiple options: anyOf)
      Limits logs to specific container(s). Repeat the parameter to select multiple containers. Build logs, OpenTofu jobs and container scans only accept the neutral value `all`.
      • [array] required
        • string required
          min length
          3
          max length
          64

        OR

      • string required
        min length
        3
        max length
        64
    • deploymentId

      string
      Limit runtime logs to a specific deployment of a service or harness. Not supported for build logs, cluster pods, OpenTofu jobs or container scans.
    • buildId

      string
      Selects logs for specific build.
    • runId

      string
      Limits metrics to a specific job run id.
      min length
      36
      max length
      36
    • queryType

      string
      `range` selects a log range and returns immediately.
      one of
      range
    • startTime

      string
      Fetch logs generated after this timestamp.
    • endTime

      string
      Fetch logs generated before this timestamp.
    • duration

      integer
      Range duration in seconds. If set, only one of `startTime` or `endTime` can be set.
    • lineLimit

      integer
      Number of log lines to fetch.
      min
      0
      max
      1000
    • direction

      string
      Ordering of log lines
      one of
      backward, forward
    • textIncludes

      string
      Filter log lines to match this search string
      min length
      1
      max length
      100
    • textNotIncludes

      string
      Filter log lines to not match this search string
      min length
      1
      max length
      100
    • regexIncludes

      string
      Filter log lines to match this regular expression
      min length
      1
      max length
      100
    • regexNotIncludes

      string
      Filter log lines to not match this regular expression
      min length
      1
      max length
      100

Response body

  • {object}
    Response object.
    • data

      [array] required
      Result data.
      • {object}
        • containerId

          string required
        • log

          required
        • ts

          string required

GET /v1/logs

GET /v1/teams/{teamId}/logs

Example response

200 OK

List of logs values

JSON

{
  "data": [
    {
      "log": "stdout F This is a log line",
      "ts": "2023-03-21T15:01:17.310Z"
    }
  ]
}

© 2026 Northflank Ltd. All rights reserved.

northflank.com / Terms / Privacy / feedback@northflank.com