Use MQTT output plugin on logstash workers

This commit will enable the mqtt output plugin on logstash workers. So
now we'll be emitting logstash events to the firehose for anyone to
listen to.

Change-Id: I570a461ee13f5dfa5494554df1cc321fc6cdbf6c
Depends-On: I7255f6c256ab3e3ca33caf69b71bf4ffab02c1bb
This commit is contained in:
Matthew Treinish 2016-09-13 12:42:47 -04:00
parent 2bc5dd7ca4
commit a22b5a9066
No known key found for this signature in database
GPG Key ID: FD12A0F214C9E177
3 changed files with 27 additions and 3 deletions

View File

@ -460,6 +460,9 @@ node /^logstash-worker\d+\.openstack\.org$/ {
class { 'openstack_project::logstash_worker':
discover_node => 'elasticsearch02.openstack.org',
enable_mqtt => true,
mqtt_password => hiera('mqtt_service_user_password'),
mqtt_ca_cert_contents => hiera('mosquitto_tls_ca_file'),
}
}

View File

@ -18,6 +18,13 @@ class openstack_project::logstash_worker (
$discover_node = 'elasticsearch01.openstack.org',
$filter_rev = 'master',
$filter_source = 'https://git.openstack.org/openstack-infra/logstash-filters',
$enable_mqtt = false,
$mqtt_hostname = 'firehose.openstack.org',
$mqtt_port = 8883,
$mqtt_topic = "logstash/${::hostname}",
$mqtt_username = 'infra',
$mqtt_password = undef,
$mqtt_ca_cert_contents = undef,
) {
file { '/etc/default/logstash-indexer':
ensure => present,
@ -47,9 +54,11 @@ class openstack_project::logstash_worker (
}
class { '::logstash::indexer':
input_template => 'openstack_project/logstash/input.conf.erb',
output_template => 'openstack_project/logstash/output.conf.erb',
require => Logstash::Filter['openstack-logstash-filters'],
input_template => 'openstack_project/logstash/input.conf.erb',
output_template => 'openstack_project/logstash/output.conf.erb',
enable_mqtt => $enable_mqtt,
mqtt_ca_cert_contents => $mqtt_ca_cert_contents,
require => Logstash::Filter['openstack-logstash-filters'],
}
include ::log_processor

View File

@ -4,4 +4,16 @@ output {
manage_template => false
flush_size => 1024
}
<% if @enable_mqtt -%>
mqtt {
host => <%= @mqtt_hostname %>
port => <%= @mqtt_port %>
topic => <%= @mqtt_topic %>
username => <%= @mqtt_username %>
password => <%= @mqtt_password %>
ssl => true
ca_file => "/etc/logstash/mqtt-root-CA.crt"
}
<% end -%>
}