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:
parent
2bc5dd7ca4
commit
a22b5a9066
@ -460,6 +460,9 @@ node /^logstash-worker\d+\.openstack\.org$/ {
|
|||||||
|
|
||||||
class { 'openstack_project::logstash_worker':
|
class { 'openstack_project::logstash_worker':
|
||||||
discover_node => 'elasticsearch02.openstack.org',
|
discover_node => 'elasticsearch02.openstack.org',
|
||||||
|
enable_mqtt => true,
|
||||||
|
mqtt_password => hiera('mqtt_service_user_password'),
|
||||||
|
mqtt_ca_cert_contents => hiera('mosquitto_tls_ca_file'),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,13 @@ class openstack_project::logstash_worker (
|
|||||||
$discover_node = 'elasticsearch01.openstack.org',
|
$discover_node = 'elasticsearch01.openstack.org',
|
||||||
$filter_rev = 'master',
|
$filter_rev = 'master',
|
||||||
$filter_source = 'https://git.openstack.org/openstack-infra/logstash-filters',
|
$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':
|
file { '/etc/default/logstash-indexer':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
@ -47,9 +54,11 @@ class openstack_project::logstash_worker (
|
|||||||
}
|
}
|
||||||
|
|
||||||
class { '::logstash::indexer':
|
class { '::logstash::indexer':
|
||||||
input_template => 'openstack_project/logstash/input.conf.erb',
|
input_template => 'openstack_project/logstash/input.conf.erb',
|
||||||
output_template => 'openstack_project/logstash/output.conf.erb',
|
output_template => 'openstack_project/logstash/output.conf.erb',
|
||||||
require => Logstash::Filter['openstack-logstash-filters'],
|
enable_mqtt => $enable_mqtt,
|
||||||
|
mqtt_ca_cert_contents => $mqtt_ca_cert_contents,
|
||||||
|
require => Logstash::Filter['openstack-logstash-filters'],
|
||||||
}
|
}
|
||||||
|
|
||||||
include ::log_processor
|
include ::log_processor
|
||||||
|
@ -4,4 +4,16 @@ output {
|
|||||||
manage_template => false
|
manage_template => false
|
||||||
flush_size => 1024
|
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 -%>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user