Placing data into new indexes by type
Posted: Tue Mar 10, 2015 1:58 pm
What is the logserver supported method to send data of a certain type to another index?
We tried adding an if statement to the output section, but we found when we did this that data was being written to the default logstash-YYYY.MM.dd index and the syslog-YYYY.MM.dd index we created.
This looks to be happening because of the way logserver puts the default output entry into the configuration file.
Any ideas on how to properly do this?
We tried adding an if statement to the output section, but we found when we did this that data was being written to the default logstash-YYYY.MM.dd index and the syslog-YYYY.MM.dd index we created.
This looks to be happening because of the way logserver puts the default output entry into the configuration file.
Any ideas on how to properly do this?
Code: Select all
[root@hostname conf.d]# pwd
/usr/local/nagioslogserver/logstash/etc/conf.d
[root@hostname conf.d]# cat 999_outputs.conf
#
# Logstash Configuration File
# Dynamically created by Nagios Log Server
#
# DO NOT EDIT THIS FILE. IT WILL BE OVERWRITTEN.
#
# Created Tue, 10 Mar 2015 13:43:44 -0500
#
#
# Required output for Nagios Log Server
#
output {
elasticsearch {
cluster => 'xxxxxxx-xxxxxx-xxxxxx-xxxx-xxxxxxxx'
host => 'localhost'
index_type => '%{type}'
node_name => 'xxxxxxx-xxxxxx-xxxxxx-xxxx-xxxxxxxx'
protocol => 'transport'
workers => 4
}
}
#
# Global outputs
#
output {
if [type] == 'syslog' {
elasticsearch {
index => 'syslog-%{+YYYY.MM.dd}'
cluster => 'xxxxxxx-xxxxxx-xxxxxx-xxxx-xxxxxxxx'
host => 'localhost'
index_type => '%{type}'
node_name => 'xxxxxxx-xxxxxx-xxxxxx-xxxx-xxxxxxxx'
protocol => 'transport'
workers => 4
}
}
}
#
# Local outputs
#
[root@hostname conf.d]#