HTTP is the foundation of data exchange on the web. Tenzir provides operators for all sides of an HTTP conversation: fetching data from APIs, sending events to webhooks, streaming data to clients, and accepting incoming requests.
Fetching data from APIs
Section titled “Fetching data from APIs”When retrieving data from an API or website, you prepare your HTTP request and get back the HTTP response body as your pipeline data:
Use from_http to issue a one-shot HTTP
request, or http to enrich events flowing through
a pipeline with HTTP responses. Both operators automatically infer the response
format from the URL extension or Content-Type header.
See the Fetch via HTTP and APIs guide for practical examples covering authentication, pagination, error handling, and data enrichment.
Sending data to webhooks and APIs
Section titled “Sending data to webhooks and APIs”Use to_http to send events as HTTP requests to
a webhook or API endpoint. Each input event is sent as a separate request, with
the event JSON-encoded as the body by default. This is useful for pushing alerts
to webhooks, forwarding events to SIEMs, or calling external APIs for each
event.
Streaming data to HTTP clients
Section titled “Streaming data to HTTP clients”Use serve_http to start an HTTP server that
streams pipeline events as NDJSON to connected clients. Each client receives a
copy of every event. This is useful when external systems need to pull data from
your pipeline over HTTP.
See the Expose data as a server guide for practical examples covering health checks, connection limits, and TLS.
Accepting incoming requests
Section titled “Accepting incoming requests”Use accept_http to spin up an HTTP server
that turns incoming requests into pipeline events. This is useful for receiving
webhooks, building custom API endpoints, or ingesting data pushed by external
systems.
SSL/TLS
Section titled “SSL/TLS”All HTTP operators support TLS. Pass tls={} to enable TLS with defaults, or
provide a record with specific options like certfile and keyfile.