zeromq

Milestone: 2

Write events to a 0MQ PUB socket.

You need to have the 0mq 2.1.x library installed to be able to use this output plugin.

The default settings will create a publisher connecting to a subscriber bound to tcp://127.0.0.1:2120

Synopsis

This is what it might look like in your config file:
output {
  zeromq {
    address => ... # array (optional), default: ["tcp://127.0.0.1:2120"]
    codec => ... # codec (optional), default: "plain"
    mode => ... # string, one of ["server", "client"] (optional), default: "client"
    sockopt => ... # hash (optional)
    topic => ... # string (optional), default: ""
    topology => ... # string, one of ["pushpull", "pubsub", "pair"] (required)
    workers => ... # number (optional), default: 1
  }
}

Details

address

  • Value type is array
  • Default value is ["tcp://127.0.0.1:2120"]

0mq socket address to connect or bind. Please note that inproc:// will not work with logstashi. For each we use a context per thread. By default, inputs bind/listen and outputs connect.

codec

  • Value type is codec
  • Default value is "plain"

The codec used for output data. Output codecs are a convenient method for encoding your data before it leaves the output, without needing a separate filter in your Logstash pipeline.

exclude_tags DEPRECATED

  • DEPRECATED WARNING: This config item is deprecated. It may be removed in a further version.
  • Value type is array
  • Default value is []

Only handle events without any of these tags. Note this check is additional to type and tags.

mode

  • Value can be any of: "server", "client"
  • Default value is "client"

Server mode binds/listens. Client mode connects.

sockopt

  • Value type is hash
  • There is no default value for this setting.

This exposes zmq_setsockopt for advanced tuning. See http://api.zeromq.org/2-1:zmq-setsockopt for details.

This is where you would set values like:

  • ZMQ::HWM - high water mark
  • ZMQ::IDENTITY - named queues
  • ZMQ::SWAP_SIZE - space for disk overflow

Example: sockopt => [“ZMQ::HWM”, 50, “ZMQ::IDENTITY”, “my_named_queue”]

tags DEPRECATED

  • DEPRECATED WARNING: This config item is deprecated. It may be removed in a further version.
  • Value type is array
  • Default value is []

Only handle events with all of these tags. Note that if you specify a type, the event must also match that type. Optional.

topic

  • Value type is string
  • Default value is ""

This is used for the ‘pubsub’ topology only. On inputs, this allows you to filter messages by topic. On outputs, this allows you to tag a message for routing. NOTE: ZeroMQ does subscriber-side filtering NOTE: Topic is evaluated with event.sprintf so macros are valid here.

topology (required setting)

  • Value can be any of: "pushpull", "pubsub", "pair"
  • There is no default value for this setting.

The default logstash topologies work as follows:

  • pushpull - inputs are pull, outputs are push
  • pubsub - inputs are subscribers, outputs are publishers
  • pair - inputs are clients, inputs are servers

If the predefined topology flows don’t work for you, you can change the ‘mode’ setting TODO (lusis) add req/rep MAYBE TODO (lusis) add router/dealer

type DEPRECATED

  • DEPRECATED WARNING: This config item is deprecated. It may be removed in a further version.
  • Value type is string
  • Default value is ""

The type to act on. If a type is given, then this output will only act on messages with the same type. See any input plugin’s “type” attribute for more. Optional.

workers

  • Value type is number
  • Default value is 1

The number of workers to use for this output. Note that this setting may not be useful for all outputs.


This is documentation from lib/logstash/outputs/zeromq.rb