Skip to content
Navigation

Ingest events

The batch is atomic: every event is stored or none is. Event times must fall between now minus the retention period and now plus the allowed future skew (five minutes by default). Producer fields that Logbrook doesn't map are kept in attributes. The first authorized write to a missing index creates it, up to max_indexes.

POST
/indexes/{index}/logs/ingest

Authorization

  • bearerAuth
    HTTP
    required

Path parameters

  • index
    string
    required

    Index name: lowercase letters, digits, underscores and hyphens. The token's index scope applies as well as its source scope.

    maxLength: 63 · minLength: 1 · pattern: ^[a-z0-9][a-z0-9_-]*$

Request body JSON required

  • time
    integer
    required

    Unix milliseconds

    minimum: 0
  • level
    integer
    required
    minimum: 0
  • msg
    string
    required
  • service
    optional
    string | null
  • name
    optional
    string | null
  • hostname
    optional
    string | null
  • pid
    optional
    integer | null
    minimum: 0

Request body

X-NDJSON
"{\"time\":1794297417000,\"level\":30,\"msg\":\"payment authorized\",\"service\":\"checkout-api\",\"name\":\"payments\",\"hostname\":\"web-1\",\"pid\":4182,\"orderId\":\"ord_8f3k2\",\"amountCents\":4999,\"currency\":\"EUR\"}\n{\"time\":1794297418500,\"level\":40,\"msg\":\"card issuer slow to respond\",\"service\":\"checkout-api\",\"name\":\"payments\",\"hostname\":\"web-1\",\"pid\":4182,\"orderId\":\"ord_8f3k3\",\"latencyMs\":2380}\n{\"time\":1794297421200,\"level\":50,\"msg\":\"payment declined\",\"service\":\"checkout-api\",\"name\":\"payments\",\"hostname\":\"web-2\",\"pid\":3920,\"orderId\":\"ord_8f3k4\",\"reason\":\"insufficient_funds\"}\n"

Returns

200

Successful response

JSON
  • accepted
    integer
    required
    minimum: 0

400

Invalid input
JSON
  • error
    string
    required

401

Missing or invalid token
JSON
  • error
    string
    required

403

Source outside read scope
JSON
  • error
    string
    required

404

Index not found
JSON
  • error
    string
    required

413

Payload exceeds configured budget
JSON
  • error
    string
    required

429

Capacity exhausted; Retry-After: 1
JSON
  • error
    string
    required

503

Storage unavailable
JSON
  • error
    string
    required

504

Query deadline expired
JSON
  • error
    string
    required

507

The index's disk-size budget is exhausted. The oldest history may be reclaimed before later requests are accepted.
JSON
  • error
    string
    required

Type to search…

↑↓ navigate↵ selectEsc close