I enabled netflow module in logstash 5.6.3 several days ago and today started to stream the flows into logstash. Before that I had collected the logs via filebeat already. What I noticed is that filebeat's stuff appeared inside netflow index.
Seems like the reason is the next: When logstash activates netflow module - it merges the configuration from its template with the configuration which already exists.
In the /usr/share/logstash/modules/netflow/configuration/logstash/netflow.conf.erb there is a block of:
output {
<%= elasticsearch_output_config() %>
}
Andd if you look at the function definition at /usr/share/logstash/logstash-core/lib/logstash/modules/logstash_config.rb, you can see:
def elasticsearch_output_config(type_string = nil)
hosts = array_to_string(get_setting(LogStash::Setting::SplittableStringArray.new("var.elasticsearch.hosts", String, ["localhost:9200"])))
index = "#{@name}-#{setting("var.elasticsearch.index_suffix", "%{+YYYY.MM.dd}")}"
user = @settings["var.elasticsearch.username"]
password = @settings["var.elasticsearch.password"]
lines = ["hosts => #{hosts}", "index => \"#{index}\""]
lines.push(user ? "user => \"#{user}\"" : nil)
lines.push(password ? "password => \"#{password}\"" : nil)
lines.push(type_string ? "document_type => #{type_string}" : nil)
lines.push("ssl => #{@settings.fetch('var.elasticsearch.ssl.enabled', false)}")
if cacert = @settings["var.elasticsearch.ssl.certificate_authority"]
lines.push("cacert => \"#{cacert}\"") if cacert
end
# NOTE: the first line should be indented in the conf.erb
<<-CONF
elasticsearch {
#{lines.compact.join("\n ")}
manage_template => false
}
CONF
end
This guy puts another one configuration for elasticsearch and throws everything into the index "netflow-%{+YYYY.MM.dd}".
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.