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
stringID of the project the targeted resource belongs to. Required when targeting a service, job, harness, addon or container scan.clusterId
stringID 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
stringName 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
stringID of the service to target.jobId
stringID of the job to target.harnessId
stringID of the harness to target.addonId
stringID of the addon to target.containerScanId
stringID 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
stringID of the addon backup to target. Requires `addonId`.restoreId
stringID of the addon backup restore to target. Requires `backupId`.opentofuJobId
stringID of the OpenTofu job to target. Does not support podName, containerName selectors, deploymentId or type filters.logSource
stringSource 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 ofruntime, build, backup, restoretype
stringType of log. Multiple log types can be selected by specifying the query parameter repeatedly.one ofcdn, mesh, ingress, runtime, build, backup, restorecontainerName
(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 requiredmin length3max length64
- string requiredmin length3max length64
deploymentId
stringLimit runtime logs to a specific deployment of a service or harness. Not supported for build logs, cluster pods, OpenTofu jobs or container scans.buildId
stringSelects logs for specific build.runId
stringLimits metrics to a specific job run id.min length36max length36queryType
string`range` selects a log range and returns immediately.one ofrangestartTime
stringFetch logs generated after this timestamp.endTime
stringFetch logs generated before this timestamp.duration
integerRange duration in seconds. If set, only one of `startTime` or `endTime` can be set.lineLimit
integerNumber of log lines to fetch.min0max1000direction
stringOrdering of log linesone ofbackward, forwardtextIncludes
stringFilter log lines to match this search stringmin length1max length100textNotIncludes
stringFilter log lines to not match this search stringmin length1max length100regexIncludes
stringFilter log lines to match this regular expressionmin length1max length100regexNotIncludes
stringFilter log lines to not match this regular expressionmin length1max length100
OR
Response body
- {object}Response object.
data
[array] requiredResult data.- {object}
containerId
string requiredlog
requiredts
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"
}
]
}