Skip to content

Connects to a remote ZeroMQ subscriber endpoint and sends events.

to_zmq endpoint:string, encoding=string, [prefix=string, monitor=bool]

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.

The remote endpoint to connect to. This is typically a ZeroMQ endpoint such as tcp://host:port, ipc://path, or inproc://name.

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.

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.

Waits for the first peer connection before publishing messages on TCP transports.

export
to_zmq "tcp://collector.example.com:5555", encoding="json"
export
to_zmq "tcp://collector.example.com:5555", encoding="ndjson", prefix=source + "/"

Last updated: