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
This commit is contained in:
Matthew Treinish 2016-08-04 15:05:33 -04:00
parent f671fcf2c9
commit 616156f9a1
No known key found for this signature in database
GPG Key ID: FD12A0F214C9E177
1 changed files with 17 additions and 0 deletions

View File

@ -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'],
onlyif => '/opt/logstash/bin/plugin list logstash-output-mqtt',
}
file { '/etc/logstash/mqtt-root-CA.pem.crt':
ensure => present,
content => $mqtt_ca_cert_contents,
owner => 'logstash',
group => 'logstash',
mode => '0600',
notify => Service['logstash']
}
}
service { 'logstash':
ensure => running,
enable => true,