key "D27D666CD88E42B4"
end
-apt_source "logstash-forwarder" do
- source_template "elasticsearch.list.erb"
- url "https://packages.elasticsearch.org/logstashforwarder/debian"
- key "D27D666CD88E42B4"
-end
-
apt_source "passenger" do
url "https://oss-binaries.phusionpassenger.com/apt/passenger"
key "561F9B9CAC40B2F7"
~FC001
~FC003
+~FC019
~FC064
~FC065
~FC066
-default[:logstash][:forwarder][:network][:servers] = ["logstash.openstreetmap.org:5043"]
-default[:logstash][:forwarder][:network][:"ssl ca"] = "/var/lib/logstash-forwarder/lumberjack.crt"
-default[:logstash][:forwarder][:files] = []
+default[:logstash][:forwarder]["output.logstash"]["hosts"] = ["logstash.openstreetmap.org:5044"]
+default[:logstash][:forwarder]["output.logstash"]["ssl.certificate_authorities"] = "/etc/filebeat/filebeat.crt"
+default[:logstash][:forwarder]["output.logstash"]["ssl.verification_mode"] = "none"
+default[:logstash][:forwarder]["filebeat.prospectors"] = []
# limitations under the License.
#
-require "json"
+service "logstash-forwarder" do
+ action [:disable, :stop]
+end
+
+file "/var/lib/logstash-forwarder/lumberjack.crt" do
+ action :delete
+end
-package "logstash-forwarder"
+package "logstash-forwarder" do
+ action :purge
+end
+
+require "yaml"
-cookbook_file "/var/lib/logstash-forwarder/lumberjack.crt" do
- source "lumberjack.crt"
+package "filebeat"
+
+cookbook_file "/etc/filebeat/filebeat.crt" do
+ source "beats.crt"
user "root"
group "root"
- mode 0o644
- notifies :restart, "service[logstash-forwarder]"
+ mode 0o600
+ notifies :restart, "service[filebeat]"
end
-file "/etc/logstash-forwarder.conf" do
- content JSON.pretty_generate(node[:logstash][:forwarder])
+file "/etc/filebeat/filebeat.yml" do
+ content YAML.dump(node[:logstash][:forwarder].to_hash)
user "root"
group "root"
- mode 0o644
- notifies :restart, "service[logstash-forwarder]"
+ mode 0o600
+ notifies :restart, "service[filebeat]"
end
-service "logstash-forwarder" do
+service "filebeat" do
action [:enable, :start]
supports :status => true, :restart => true
end
default_attributes(
:apt => {
- # :sources => ["logstash-forwarder"]
+ :sources => ["elasticsearch5.x"]
}
)
},
:logstash => {
:forwarder => {
- :files => [
- { :paths => ["/var/log/apache2/access.log"], :fields => { :type => "apache" } },
- { :paths => ["/var/log/web/rails-logstash.log"], :fields => { :type => "rails" } }
+ "filebeat.prospectors" => [
+ { "input_type" => "log", "paths" => ["/var/log/apache2/access.log"], "fields" => { "type" => "apache" } },
+ { "input_type" => "log", "paths" => ["/var/log/web/rails-logstash.log"], "fields" => { "type" => "rails" } }
]
}
},
},
:logstash => {
:forwarder => {
- :files => [
- { :paths => ["/var/log/apache2/access.log"], :fields => { :type => "apache" } },
- { :paths => ["/var/log/web/rails-logstash.log"], :fields => { :type => "rails" } }
+ "filebeat.prospectors" => [
+ { "input_type" => "log", "paths" => ["/var/log/apache2/access.log"], "fields" => { "type" => "apache" } },
+ { "input_type" => "log", "paths" => ["/var/log/web/rails-logstash.log"], "fields" => { "type" => "rails" } }
]
}
},