[syslog-ng] [PATCH 0/2]: afamqp: AMQP destination driver
Gergely Nagy
algernon at balabit.hu
Tue Oct 9 18:13:04 CEST 2012
The two patches that will follow implement an AMQP destination driver
for syslog-ng, contributed by Attila Nagy <bra at fsn.hu>, with a few
minor enhancements and porting to syslog-ng 3.4 by myself.
The patch is also available on the feature/3.4/amqp[1] and
feature/3.3/amqp[2] branches of my git repository, for syslog-ng 3.4
and 3.3 respectively. Functionally, they're exactly the same, but all
further improvements and fixes will go to the 3.4 branch only, the 3.3
branch is there for testing and historical purposes only, and will be
removed sometime after the driver gets merged to 3.4.
Now, I won't explain in detail what AMQP is, let it suffice that it is
a messaging protocol, of which RabbitMQ[3] is an implementation
of. Interested people can read the available documentation, there's
plenty!
For now, lets concentrate on how to take the driver for a test drive!
Once rabbitmq is installed (on debian and derivatives of recent
versions it is as simple as apt-get install rabbitmq-server), all one
needs to do, is configure syslog-ng to send messages, and grab a
client that can look at the queue. For testing purposes, there's a
simple one at https://gist.github.com/3859756 - you'll need a couple
of python modules for that.
What it does, is it sets up a queue named 'test', and binds it to the
'syslog' exchange (the default used by the AMQP driver), and starts
consuming messages. It prints both headers and the payload (if any, by
default, there is no payload).
What one needs to know about the driver, is that it does not declare
any queues: it's the responsibility of the admin to set queues up, and
route messages as they see fit. This can be done on the RabbitMQ web
admin interface (again, see the docs about that!), among other things,
or programmatically, like the script above does.
Hopefully, this is enough to get one started! If not, I plan to write
a more detailed blog post about the topic in the not too distant
future.
There are plans to write an accompanying source driver too, but work
has not started on that front yet. Rest assured though, it will come.
I'd like to thank Attila again for contributing the driver, and
answering my silly questions during review - both are much
appreciated!
[1]: https://github.com/algernon/syslog-ng/tree/feature/3.4/amqp
[2]: https://github.com/algernon/syslog-ng/tree/feature/3.3/amqp
[3]: http://www.rabbitmq.com/
More information about the syslog-ng
mailing list