Skip to main content
Monitoring & Collection/Logging

GetLogContext

Retrieve surrounding log lines before and after a specific log entry

POST/api/v1/logs/context

Operation ID

GetLogContext

Since

1.0

Execution Mode

Synchronous

Auth Context

Auth Required

Auth Context

Send these values as request headers when calling this API.

AuthorizationstringRequired

Bearer Token

X-Tenant-IDstring

X-Tenant-ID

Request Inputs

application/json

Body Fields

  • logId
    StringRequired

    Unique identifier of the target log entry to retrieve context for

    Example: logline-0042

  • source
    StringRequired

    Log source identifier that contains the target log entry

    Example: /var/log/app/service.log

  • before
    IntegerRequired

    Number of log lines to return before the target log entry

    Example: 10

  • after
    IntegerRequired

    Number of log lines to return after the target log entry

    Example: 10

Responses

200 OK
200 OK

On success, this API returns the following response structure.

  • target
    Object

    Target for this resource

    • id
      String

      Unique identifier of this log line

      Example: logline-0042

    • timestamp
      String

      Timestamp for this resource

      Example: 2026-01-15T08:00:00Z

    • level
      String

      Severity level of this log line

      Example: error

    • source
      String

      Log source path or stream identifier

      Example: /var/log/app/service.log

    • message
      String

      Human-readable log message content

      Example: NullPointerException in OrderProcessor

    • host
      String

      Hostname of the machine that emitted this log line

      Example: node-01.prod

    • fields
      LinkedHashMap

      Field list to include in the response

      Example: (nested object)

  • before
    List

    Before for this resource

    Example: (nested array)

    • id
      String

      Unique identifier of this log line

      Example: logline-0042

    • timestamp
      String

      Timestamp for this resource

      Example: 2026-01-15T08:00:00Z

    • level
      String

      Severity level of this log line

      Example: error

    • source
      String

      Log source path or stream identifier

      Example: /var/log/app/service.log

    • message
      String

      Human-readable log message content

      Example: NullPointerException in OrderProcessor

    • host
      String

      Hostname of the machine that emitted this log line

      Example: node-01.prod

    • fields
      LinkedHashMap

      Field list to include in the response

      Example: (nested object)

  • after
    List

    After for this resource

    Example: (nested array)

    • id
      String

      Unique identifier of this log line

      Example: logline-0042

    • timestamp
      String

      Timestamp for this resource

      Example: 2026-01-15T08:00:00Z

    • level
      String

      Severity level of this log line

      Example: error

    • source
      String

      Log source path or stream identifier

      Example: /var/log/app/service.log

    • message
      String

      Human-readable log message content

      Example: NullPointerException in OrderProcessor

    • host
      String

      Hostname of the machine that emitted this log line

      Example: node-01.prod

    • fields
      LinkedHashMap

      Field list to include in the response

      Example: (nested object)

  • totalLines
    Integer

    Total number of lines returned including before, target, and after

    Example: 21

  • hasMore
    Boolean

    Whether additional context lines exist beyond the requested range

    Example: false

Change History

This API has no change history records yet.

View all change history