Connects to a remote ZeroMQ subscriber endpoint and sends events.
to_zmq endpoint:string, encoding=string, [prefix=string, monitor=bool]Description
Section titled “Description”Connects to the specified ZeroMQ endpoint as a PUB socket and publishes one
message per input event.
The operator serializes each event with the selected encoding and optionally
prepends a prefix to the serialized bytes before publishing the message. This
prefix is intended for PUB/SUB-style routing and matches the prefix option of
from_zmq and accept_zmq.
If the connection fails, the operator retries with exponential backoff.
endpoint: string
Section titled “endpoint: string”The remote endpoint to connect to. This is typically a ZeroMQ endpoint such as
tcp://host:port, ipc://path, or inproc://name.
encoding = string
Section titled “encoding = string”The encoding to use when serializing input events into ZeroMQ message payloads.
Use the same format names that you would otherwise select with a write_*
operator, for example json, ndjson, csv, or yaml.
prefix = string (optional)
Section titled “prefix = string (optional)”An expression that evaluates to the prefix to prepend to each published message.
Unlike the read-side prefix, this expression may depend on event fields. The
operator evaluates it for every input event.
monitor = bool (optional)
Section titled “monitor = bool (optional)”Waits for the first peer connection before publishing messages on TCP transports.
Examples
Section titled “Examples”Connect and publish JSON
Section titled “Connect and publish JSON”exportto_zmq "tcp://collector.example.com:5555", encoding="json"Publish per-event prefixes
Section titled “Publish per-event prefixes”exportto_zmq "tcp://collector.example.com:5555", encoding="ndjson", prefix=source + "/"