ZeroMQ input and output modules for rsyslog.
This module allows rsyslog to read and write ZeroMQ messages.
Tested with rsyslog-5.8.0.
-
Install zeromq, will need headers and devel libraries ...
-
Apply the patch 'rsyslog-zeromq.patch' to the source of rsyslog:
cd path/to/rsyslog-5.8.0 patch -p1 -i rsyslog-zeromq.patch
-
Copy imzeromq and omzeromq directories to plugins directory of rsyslog source.
rsync -av {i,o}mzeromq path/to/rsyslog-5.8.0/plugins
-
Regenerate autotools related files:
cd path/to/rsyslog-5.8.0 autoreconf
-
Add '--enable-imzeromq' and '--enable-omzeromq' to ./configure switches.
./configure \ --enable-imzeromq \ --enable-omzeromq \ <your-other-flags-here>
-
Build and install.
cd path/to/rsyslog-5.8.0 make make install
The :omzeromq: selector takes the following parameter components:
- connect=<endpoint> Connect to the specified endpoint.
- bind=<endpoint> Bind to the specified endpoint.
- identity=<identstr> Sets the identity of the socket.
- hwm=<NNN> Sets the high water mark of the socket.
- swap=<NNN> Sets the swap value for the socket.
- threads=<N> Sets the number of zeromq context threads.
- pattern=<patternstr> Sets the messaging pattern (push or pub).
The format for the selector may be specified in the standard way with a trailing ";<FORMAT>" specifier.
Examples:
$ModLoad omzeromq.so
# Minimal configuration:
*.* :omzeromq:bind=tcp://*:5557
# Full config, all parameters specified:
*.* :omzeromq:bind=tcp://*:5557,hwm=1000,swap=9999,identity=foobar,threads=1;RSYSLOG_ForwardFormat
The $InputZeroMQServerRun directive takes the following parameter components:
- connect=<endpoint> Connect to the specified endpoint.
- bind=<endpoint> Bind to the specified endpoint.
- identity=<identstr> Sets the identity of the socket.
- pattern=<patternstr> Sets the messaging pattern (pull or sub).
- subscribe=<filterstr> Sets a subscription filter.
Examples:
$ModLoad imzeromq.so
$RuleSet Events
... ruleset definition here ...
# Provides ZeroMQ reception on a PULL socket.
$InputZeroMQServerBindRuleset Events1
$InputZeroMQServerRun pattern=pull,connect=tcp://*:5557,identity=yoyo
# Subscribe to all records from a SUB socket (empty filter string)
$InputZeroMQServerBindRuleset Events2
$InputZeroMQServerRun pattern=sub,connect=tcp://*:5557,subscribe=,
# Subscribe to just "foo" and "bar" records.
$InputZeroMQServerBindRuleset Events3
$InputZeroMQServerRun pattern=sub,connect=tcp://*:5557,subscribe=foo,subscribe=bar