AMQP 1.0 plugins for logstash

Introduction

logstash is an open source tool to collect, distribute and manage logs. We provide 2 plugins for output to and input from an AMQP 1.0 address. The plugins use SwiftMQ's AMQP 1.0 Java Client which works with SwiftMQ and other AMQP 1.0 brokers. The plugins are provided under the Apache 2.0 license.

Installation

1) If you haven't done it already, download logstash.

2) Download the plugins here and unpack it.

3) Download the SwiftMQ Client distribution here and unpack it.

logstash is provided as a single monolithic jar file where the plugins needs to be added. To do this, update the logstash jar file like this:

      $> jar -uf logstash-1.1.0-monolithic.jar logstash/*/amqp10.rb

Verify that the jar file has been properly updated:

      $> jar -tf logstash-1.1.0-monolithic.jar | grep amqp10
      logstash/inputs/amqp10.rb
      logstash/outputs/amqp10.rb

Usage

The installation directory of the SwiftMQ Client distribution needs to be specified via system property "swiftmq.install" when executing logstash:

      $> java -Dswiftmq.install=/usr/local/swiftmq_9_2_0_client \
              -jar logstash-1.1.0-monolithic.jar agent -f logstash/to_amqp10.conf

The plugin archive contains 2 example configurations for logstash. "to_amqp10.conf" reads from stdin and sends it to stdout and to the AMQP 1.0 address with SASL authentication and SSL:

      input {
        stdin { type => "foo" }
      }
      output {
        stdout { debug => true }
        amqp10 {
          use_sasl => true
          sasl_anonymous => false
          user => "admin"
          password => "secret"
          address => "testqueue"
          ssl => true
          port => 5671
        }
      }

The other example "from_amqp10.conf" receives it from the AMQP 1.0 address by using all default parameters and sends it to stdout:

      input {
        amqp10 {
          type => "foo"
          address => "testqueue"
        }
      }
      output {
        stdout { }
      }

Both plugins share the same parameter set:

Parameter Mandatory Default Description
host No localhost Hostname of the AMQP broker
port No 5672 Port of the AMQP broker
address Yes Address (e.g. queue/topic name)
persistent No true Use persistent messages
use_sasl No true Use SASL authentication
sasl_anonymous No true Use SASL anonymous login
user No admin SASL username
password No secret SASL password
ssl No false Use SSL

So if nothing but the address is specified, the plugin connects non-ssl to localhost on port 5672, authenticates with SASL as anonymous and uses persistent messages.