Ingest events
Ingest events
Send an array of JSON objects. The endpoint everything else is built on.
Post an array of JSON objects. Fields are discovered as they arrive and the dataset is created if it does not exist.
Partial success returns 200
Malformed events inside a valid batch are dropped and counted in
failed. Check that field — the status code alone will not tell you.POST
/v1/ingest/{dataset}Path parameters
datasetstringrequiredTarget dataset. Created on first write.
Query parameters
timestamp-fieldstringdefault _timeWhich field holds the event time.
timestamp-formatstringA Go time layout, for non-RFC-3339 timestamps.
Body parameters
[]arrayrequiredAn array of event objects. Up to 10,000 per request, 1 MB per event.
_timedatetimeEvent time. Defaults to arrival time. RFC 3339 or unix.
…anyEvery other key becomes a field. Nested objects flatten to dot paths.
curl -X POST https://api.logstreem.com/v1/ingest/{dataset} \
-H "Authorization: Bearer $LOGSTREEM_TOKEN" \
-H "Content-Type: application/json" \
-d '[{"level":"error","service":"checkout","status":503,"latency":3814}]'Responses
200OK
{
"object": "ingest_result",
"dataset": "api-gateway-prod",
"ingested": 1,
"failed": 0,
"processed_bytes": 214,
"blocks_created": 1
}413Too large
{
"error": {
"type": "invalid_request_error",
"code": "payload_too_large",
"message": "Request body is 14.2 MB; the limit is 10 MB compressed.",
"doc_url": "https://logstreem.com/docs/errors#payload_too_large",
"request_id": "req_1d7e4b3a09c2f856d4a1"
}
}401Unauthorized
{
"error": {
"type": "authentication_error",
"code": "missing_token",
"message": "No API token provided.",
"doc_url": "https://logstreem.com/docs/errors#missing_token",
"request_id": "req_9f3c2a7b41de08c5b2e6"
}
}Try itsandbox