POST /serve
Reads events from an existing pipeline output stream. By default, the endpoint uses long polling (timeout: 5s) and returns as soon as at least one event is available (min_events: 1).
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Pipeline output request.
object
The output stream identifier returned when the pipeline was launched.
Example
query-1The continuation token from the previous response. Omit this field for the initial request.
Example
340ce2jThe maximum number of events to return.
Example
1024The minimum number of events to wait for before returning.
Example
1The maximum time to spend on the request. Reaching the timeout returns the available events and is not an error. The timeout must not be greater than 10 seconds.
Example
200msThe schema representation to include in the response. Use exact for a representation that matches Tenzir’s type system exactly, and never to omit schema definitions.
Example
exactExample
{ "serve_id": "query-1", "max_events": 1024, "min_events": 1, "timeout": "5s", "schema": "exact"}Responses
Section titled “ Responses ”Events are available, the timeout was reached, or the pipeline reached a terminal state.
object
The token to use when reading the next batch. The value is null when the pipeline reached a terminal state.
Example
340ce2jThe pipeline state at the time of the request.
Example
runningThe schemas for the returned events. This field is omitted when the request sets schema to never.
object
The unique schema identifier.
The schema definition in JSON format.
Example
[ { "schema_id": "c631d301e4b18f4", "definition": [ { "name": "tenzir.summarize", "kind": "record", "type": "tenzir.summarize", "attributes": {}, "path": [], "fields": [ { "name": "severity", "kind": "string", "type": "string", "attributes": {}, "path": [ 0 ], "fields": [] }, { "name": "pipeline_id", "kind": "string", "type": "string", "attributes": {}, "path": [ 1 ], "fields": [] } ] } ] }]The returned events.
object
The unique schema identifier.
The event data in JSON format.
object
Example
[ { "schema_id": "c631d301e4b18f4", "data": { "timestamp": "2023-04-26T12:00:00Z", "schema": "zeek.conn", "schema_id": "ab2371bas235f1", "events": 50 } }, { "schema_id": "c631d301e4b18f4", "data": { "timestamp": "2023-04-26T12:05:00Z", "schema": "suricata.dns", "schema_id": "cd4771bas235f1", "events": 50 } }]Example
{ "next_continuation_token": "340ce2j", "state": "running", "schemas": [ { "schema_id": "c631d301e4b18f4", "definition": { "name": "tenzir.summarize", "kind": "record", "type": "tenzir.summarize", "attributes": {}, "path": [], "fields": [] } } ], "events": [ { "schema_id": "c631d301e4b18f4", "data": { "timestamp": "2023-04-26T12:00:00Z", "schema": "zeek.conn", "events": 50 } } ]}The request body is invalid.
object
The error message.
Example
Invalid arguments