From 5a9ea735e84c9ecbb5e1f67b2ed57c214b397c9c Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 4 Aug 2016 15:05:33 -0400 Subject: [PATCH] Add mqtt output plugin to logstash indexers This commit adds support for configuring the mqtt logstash output plugin. This will enable us to push events from our logstash workers to firehose.o.o. The plugin can be found here: https://github.com/kompa3/logstash-output-mqtt (althought it's README is from a template and you have to look at the inline docs for how to use it) and the gem is published on rubygems.org here: https://rubygems.org/gems/logstash-output-mqtt/ Change-Id: I7255f6c256ab3e3ca33caf69b71bf4ffab02c1bb --- manifests/indexer.pp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/manifests/indexer.pp b/manifests/indexer.pp index 728b9e2..6aa433c 100644 --- a/manifests/indexer.pp +++ b/manifests/indexer.pp @@ -31,6 +31,8 @@ class logstash::indexer ( $conf_template = undef, $input_template = 'logstash/input.conf.erb', $output_template = 'logstash/output.conf.erb', + $enable_mqtt = false, + $mqtt_ca_cert_contents = undef, ) { include ::logstash @@ -84,7 +86,22 @@ class logstash::indexer ( mode => '0644', require => Class['logstash'], } + if $enable_mqtt { + exec {'install_mqtt_plugin': + command => '/opt/logstash/bin/plugin install logstash-output-mqtt', + before => Service['logstash'] + } + file { '/etc/logstash/mqtt-root-CA.pem.crt': + ensure => present, + content => $mqtt_ca_cert_contents, + replace => true, + owner => 'logstash', + group => 'logstash', + mode => '0600', + before => Service['logstash'] + } + } service { 'logstash': ensure => running, enable => true,