Skip to content

ZeroMQ

ZeroMQ (0mq) is a light-weight messaging framework with various socket types. Tenzir supports writing to PUB sockets and reading from SUB sockets, both in server (listening) and client (connect) mode.

ZeroMQPUBconnectZeroMQPUBzmq://1.2.3.4zmq://1.2.3.4ZeroMQSUBZeroMQSUBzmq://5.6.7.8zmq://5.6.7.8Subscribe (connect)Subscribe (listen)Publish (listen)Publish (connect)

Use the IP address 0.0.0.0 to listen on all available network interfaces.

Because ZeroMQ is entirely asynchronous, publishers send messages even when no subscriber is present. This can lead to lost messages when the publisher begins operating before the subscriber. To avoid data loss due to such races, pass monitor=true to activate message buffering until at least one remote peer has connected.

Examples

Accept Syslog messages over UDP

from "zmq://127.0.0.1:541" {
read_syslog
}

Send events to a UDP socket

from {message: "Tenzir"}
to "zmq://1.2.3.4:8080" {
write_ndjson
}