Addons /
Get logs for a resource
Get logs for any Northflank resource
Query parameters
containerName
stringLimits logs to a specific container.podName
stringName of the pod to see logs ofprojectId
stringName of the project the resources belong toclusterId
stringName of the cluster the resources belong toqueryType
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
numberNumber of log lines to fetch.direction
stringOrdering of log linesone ofbackward, forwardtextIncludes
stringFilter log lines to match this search stringtextNotIncludes
stringFilter log lines to not match this search stringregexIncludes
stringFilter log lines to match this regular expressionregexNotIncludes
stringFilter log lines to not match this regular expression
Request body
- {object}
containerName
stringLimits logs to a specific container.min length3max length64podName
stringName of the pod to see logs ofprojectId
stringName of the project the resources belong toclusterId
stringName of the cluster the resources belong toqueryType
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
numberNumber 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
Response body
- {object}Response object.
data
[array] requiredResult data.- {object}
containerId
string requiredlog
requiredts
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"
}
]
}