From 500271be39efa8bf533d04214ab077b229a57882 Mon Sep 17 00:00:00 2001 From: Tudor Golubenco Date: Wed, 16 May 2018 15:16:18 +0200 Subject: [PATCH] Add sample configuration file This adds a simple Logstash config sample that works as a standard Beats -> Logstash -> Elasticsearch starting point. It's being deployed in packages, typically under /etc/logstash/logstash-sample.conf This also adds a Dockerfile that can be used to build the artifacts. Fixes #9588 --- config/logstash-sample.conf | 17 +++++++++++++++++ rakelib/artifacts.rake | 5 +++++ 2 files changed, 22 insertions(+) create mode 100644 config/logstash-sample.conf diff --git a/config/logstash-sample.conf b/config/logstash-sample.conf new file mode 100644 index 00000000000..2fa9229d62b --- /dev/null +++ b/config/logstash-sample.conf @@ -0,0 +1,17 @@ +# Sample Logstash configuration for creating a simple +# Beats -> Logstash -> Elasticsearch pipeline. + +input { + beats { + port => 5044 + } +} + +output { + elasticsearch { + hosts => ["http://localhost:9200"] + index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}" + #user => "elastic" + #password => "changeme" + } +} diff --git a/rakelib/artifacts.rake b/rakelib/artifacts.rake index cc948ea92c6..7b72a95aa73 100644 --- a/rakelib/artifacts.rake +++ b/rakelib/artifacts.rake @@ -394,6 +394,9 @@ namespace "artifact" do File.join(basedir, "config", "logstash.yml").tap do |path| dir.input("#{path}=/etc/logstash") end + File.join(basedir, "config", "logstash-sample.conf").tap do |path| + dir.input("#{path}=/etc/logstash") + end File.join(basedir, "pkg", "pipelines.yml").tap do |path| dir.input("#{path}=/etc/logstash") end @@ -415,6 +418,7 @@ namespace "artifact" do out.config_files << "/etc/logstash/jvm.options" out.config_files << "/etc/logstash/log4j2.properties" out.config_files << "/etc/logstash/logstash.yml" + out.config_files << "/etc/logstash/logstash-sample.conf" out.config_files << "/etc/logstash/pipelines.yml" when "debian", "ubuntu" require "fpm/package/deb" @@ -430,6 +434,7 @@ namespace "artifact" do out.config_files << "/etc/logstash/jvm.options" out.config_files << "/etc/logstash/log4j2.properties" out.config_files << "/etc/logstash/logstash.yml" + out.config_files << "/etc/logstash/logstash-sample.conf" out.config_files << "/etc/logstash/pipelines.yml" end