v1
Double column
API
CLI
JS Client

Addons /

Get logs for a resource

Get logs for any Northflank resource

Query parameters

    • containerName

      string
      Limits logs to a specific container.
    • podName

      string
      Name of the pod to see logs of
    • projectId

      string
      Name of the project the resources belong to
    • clusterId

      string
      Name of the cluster the resources belong to
    • 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

      number
      Number of log lines to fetch.
    • direction

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

      string
      Filter log lines to match this search string
    • textNotIncludes

      string
      Filter log lines to not match this search string
    • regexIncludes

      string
      Filter log lines to match this regular expression
    • regexNotIncludes

      string
      Filter log lines to not match this regular expression

Request body

  • {object}
    • containerName

      string
      Limits logs to a specific container.
      min length
      3
      max length
      64
    • podName

      string
      Name of the pod to see logs of
    • projectId

      string
      Name of the project the resources belong to
    • clusterId

      string
      Name of the cluster the resources belong to
    • 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

      number
      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
API
CLI
JS Client

GET /v1/logs

Example request

Request body
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request GET \
  --data '{"containerName":"my-container-67d6d748c5-kgvwh","queryType":"range","startTime":"2023-02-16T14:00:00.000Z","endTime":"2023-02-16T15:00:00.000Z","duration":600,"lineLimit":250,"direction":"backward","textIncludes":"myvalue","textNotIncludes":"myvalue","regexIncludes":"my.*value","regexNotIncludes":"my.*value"}' \
  https://api.northflank.com/v1/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"
    }
  ]
}

© 2025 Northflank Ltd. All rights reserved.