]> git.openstreetmap.org Git - chef.git/commitdiff
Update filebeat to 8.x
authorTom Hughes <tom@compton.nu>
Fri, 22 Jul 2022 12:29:02 +0000 (13:29 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 22 Jul 2022 12:33:25 +0000 (13:33 +0100)
.kitchen.yml
cookbooks/apt/recipes/default.rb
cookbooks/logstash/attributes/default.rb
roles/logstash-forwarder.rb
roles/web-frontend.rb

index 6dc0dad227c6a323a2841716223961a127021ea5..f9ac5d2439696a3db2c5ac299dc1a76c475bfc4c 100644 (file)
@@ -177,11 +177,14 @@ suites:
     attributes:
       logstash:
         forwarder:
-          filebeat.prospectors:
-            - input_type: log
+          filebeat.inputs:
+            - type: filestream
+              id: apache
               paths:
                 - /var/log/apache2/access.log
-              type: apache
+              fields:
+                type: apache
+              fields_under_root: true
   - name: mail
     run_list:
       - role[mail]
index c1355ec76a0ae2b401a9437372b9f83747c7caa6..c7e53c66928926ff903c063e47c43ef4d6eeaea6 100644 (file)
@@ -123,6 +123,14 @@ apt_repository "elasticsearch6.x" do
   key "D27D666CD88E42B4"
 end
 
+apt_repository "elasticsearch8.x" do
+  action repository_actions["elasticsearch8.x"]
+  uri "https://artifacts.elastic.co/packages/8.x/apt"
+  distribution "stable"
+  components ["main"]
+  key "D27D666CD88E42B4"
+end
+
 apt_repository "passenger" do
   action repository_actions["passenger"]
   uri "https://oss-binaries.phusionpassenger.com/apt/passenger"
index ff9cace3ef453fc814b8fd12b9fdbf3d7e719708..1b97ce33558f09c8f393f3f25c54a6b0db8f1d56 100644 (file)
@@ -1,6 +1,6 @@
 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"] = []
+default[:logstash][:forwarder]["filebeat.inputs"] = []
 
 default[:elasticsearch][:cluster][:name] = "logstash"
index cf7e7461b8f36d415b28b17e223be94aae0f14e9..509934ae4cad8877557a710e86f754f55cf5edfa 100644 (file)
@@ -3,7 +3,7 @@ description "Role applied to all logstash forwarders"
 
 default_attributes(
   :apt => {
-    :sources => ["elasticsearch6.x"]
+    :sources => ["elasticsearch8.x"]
   }
 )
 
index 2a316491a07e6cbe1c37a54e90eb8fd3fdecae38..500fb437ff3df38b69b586c1564f1fea69fef5dc 100644 (file)
@@ -15,9 +15,9 @@ default_attributes(
   },
   :logstash => {
     :forwarder => {
-      "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" } }
+      "filebeat.inputs" => [
+        { "type" => "filestream", "id" => "apache", "paths" => ["/var/log/apache2/access.log"], "fields" => { "type" => "apache" }, "fields_under_root" => true },
+        { "type" => "filestream", "id" => "rails", "paths" => ["/var/log/web/rails-logstash.log"], "fields" => { "type" => "rails" }, "fields_under_root" => true }
       ]
     }
   },