Monitoring & Collection/Logging
POSTLoggingSince 1.0SynchronousAuth Required
GetLogContext
Retrieve surrounding log lines before and after a specific log entry
Execution Availability
Try It Out
Submit a mock request using the current auth context and example-driven inputs.
Request Inputs
Body Fields
logIdStringRequiredUnique identifier of the target log entry to retrieve context for
Example: logline-0042
sourceStringRequiredLog source identifier that contains the target log entry
Example: /var/log/app/service.log
beforeIntegerRequiredNumber of log lines to return before the target log entry
Example: 10
afterIntegerRequiredNumber of log lines to return after the target log entry
Example: 10
Responses
Endpoint
POST/api/v1/logs/context
/api/v1/logs/context
Request Example
curl -X POST '{host}/api/v1/logs/context' -H 'Authorization: Bearer {token}' -H 'Content-Type: application/json' -d '{"logId":"logline-0042","source":"/var/log/app/service.log","before":10,"after":10}'
Response Example
200{
"target": {},
"before": [
{}
],
"after": [
{}
],
"totalLines": 21,
"hasMore": false
}Change History
This API has no change history records yet.
