logstash-input-beats 5.1.3-java → 5.1.4-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0fcf631f64e0aa00c02946e8e6a49eddcee3377ec7c7358df64d79e22afc202
4
- data.tar.gz: 97c7b62266a712ff1e3ce714321d1316f17e22924cc5de2c719c8b3ea2fe6530
3
+ metadata.gz: dd86798555d6cc46b4dcbdb365f9b7dbed5d7299b73738be880e339e6f6fcb2b
4
+ data.tar.gz: '0839c7ac1f1ef8a5526d8874b8d78aa240009a7fc5a7bced2e7a5c0b87e9accd'
5
5
  SHA512:
6
- metadata.gz: 1b9936a104ff6cbccc9eea6b8eefcca5d8866fad4ddb5fefcf8c98ce4f2cd09d088bf9fc60e70e5f9c3b4965a4356bda82d610a4fa7e33fe67136362acde8884
7
- data.tar.gz: 4cb4bd9dc769ad74108acb0625c1e5212743cbcae145a8217a8eec221fac6d6743b5d3f20c6073f9acf223223189d5d207320e85c98d581ed9e0da4b2af449b2
6
+ metadata.gz: 391b7b0bec241f963f3ea81495bdb57f8ec623c874f82e8668cdecdefbb86c3cef4a255a4bfbb7a081585d4441842063e90f574c35f455a5ab1fbcbc5e987be6
7
+ data.tar.gz: 046ca1c1e1a8bf71abc07166bca6d00659bb9c5ce0a416862b708ad9ac0696f765edcb2b74840cad2da5c94f23f08de075465f11abec1b741b8fcf265b084a4b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 5.1.4
2
+ - Added `add_hostname` flag to enable/disable the population of the `host` field from the beats.hostname field [#340](https://github.com/logstash-plugins/logstash-input-beats/pull/340)
3
+
1
4
  ## 5.1.3
2
5
  - Fixed handling of batches where the sequence numbers do not start with 1 [#342](https://github.com/logstash-plugins/logstash-input-beats/pull/342)
3
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.1.3
1
+ 5.1.4
data/docs/index.asciidoc CHANGED
@@ -90,6 +90,7 @@ This plugin supports the following configuration options plus the <<plugins-{typ
90
90
  [cols="<,<,<",options="header",]
91
91
  |=======================================================================
92
92
  |Setting |Input type|Required
93
+ | <<plugins-{type}s-{plugin}-add_hostname>> |<<boolean, boolean>>|No
93
94
  | <<plugins-{type}s-{plugin}-cipher_suites>> |<<array,array>>|No
94
95
  | <<plugins-{type}s-{plugin}-client_inactivity_timeout>> |<<number,number>>|No
95
96
  | <<plugins-{type}s-{plugin}-host>> |<<string,string>>|No
@@ -112,6 +113,18 @@ input plugins.
112
113
 
113
114
  &nbsp;
114
115
 
116
+ [id="plugins-{type}s-{plugin}-add_hostname"]
117
+ ===== `add_hostname`
118
+
119
+ added[5.1.4, Field was added to allow users to control whether or not the `host` field is automatically added to events.]
120
+ deprecated[5.1.4, In future versions of this plugin, this setting will be removed, and the 'hosts' field will not be added to events.]
121
+
122
+ * Value type is <<boolean,boolean>>
123
+ * Default value is `true`
124
+
125
+ Flag to determine whether to add `host` field to event using the value supplied by the beat in the `hostname` field.
126
+
127
+
115
128
  [id="plugins-{type}s-{plugin}-cipher_suites"]
116
129
  ===== `cipher_suites`
117
130
 
@@ -9,4 +9,4 @@ require_jar('com.fasterxml.jackson.core', 'jackson-annotations', '2.9.5')
9
9
  require_jar('com.fasterxml.jackson.core', 'jackson-databind', '2.9.5')
10
10
  require_jar('com.fasterxml.jackson.module', 'jackson-module-afterburner', '2.9.5')
11
11
  require_jar('org.apache.logging.log4j', 'log4j-api', '2.6.2')
12
- require_jar('org.logstash.beats', 'logstash-input-beats', '5.1.3')
12
+ require_jar('org.logstash.beats', 'logstash-input-beats', '5.1.4')
@@ -82,6 +82,10 @@ class LogStash::Inputs::Beats < LogStash::Inputs::Base
82
82
  #
83
83
  config :ssl_certificate_authorities, :validate => :array, :default => []
84
84
 
85
+ # Flag to determine whether to add host information (provided by the beat in the 'hostname' field) to the event
86
+ config :add_hostname, :validate => :boolean, :default => true, :deprecated => 'Host field will not be automatically populated by future version of the Beats input'
87
+
88
+
85
89
  # By default the server doesn't do any client verification.
86
90
  #
87
91
  # `peer` will make the server ask the client to provide a certificate.
@@ -12,6 +12,7 @@ module LogStash module Inputs class Beats
12
12
  # Copies the beat.hostname field into the host field unless
13
13
  # the host field is already defined
14
14
  def copy_beat_hostname(event)
15
+ return unless @input.add_hostname
15
16
  host = event.get("[beat][hostname]")
16
17
 
17
18
  if host && event.get("host").nil?
@@ -25,31 +25,126 @@ shared_examples "Common Event Transformation" do
25
25
  expect(subject.get("tags")).to include(tag)
26
26
  end
27
27
 
28
- context "when the `beats.hostname` doesnt exist on the event" do
29
- let(:already_exist) { "already_exist" }
30
- let(:event_map) { super.merge({ "host" => already_exist }) }
28
+ context 'when add_hostname is true' do
29
+ let(:config) { super.merge({'add_hostname' => true})}
31
30
 
32
- it "doesnt change the value" do
33
- expect(subject.get("host")).to eq(already_exist)
31
+ context 'when a host is provided in beat.host.name' do
32
+ let(:already_exist) { "already_exist" }
33
+ let(:producer_host) { "newhost01" }
34
+ let(:event_map) { super.merge({ "beat" => { "host" => {"name" => producer_host }}}) }
35
+
36
+ context "when no `host` key already exists on the event" do
37
+ it "does not set the host value" do
38
+ expect(subject.get("host")).to be_nil
39
+ end
40
+ end
41
+
42
+ context "when `host` key exists on the event" do
43
+ let(:already_exist) { "already_exist" }
44
+ let(:event_map) { super.merge({ "host" => already_exist }) }
45
+
46
+ it "doesn't override it" do
47
+ expect(subject.get("host")).to eq(already_exist)
48
+ end
49
+ end
34
50
  end
35
- end
36
51
 
37
- context "when the `beat.hostname` exist in the event" do
38
- let(:producer_host) { "newhost01" }
39
- let(:event_map) { super.merge({ "beat" => { "hostname" => producer_host }}) }
52
+ context "when a host is set in `beat.hostname`" do
53
+ let(:producer_host) { "newhost01" }
54
+ let(:event_map) { super.merge({ "beat" => { "hostname" => producer_host }}) }
40
55
 
41
- context "when `host` key doesn't exist on the event" do
42
- it "copy the `beat.hostname` to `host` or backward compatibility" do
43
- expect(subject.get("host")).to eq(producer_host)
56
+ context "when no `host` key already exists on the event" do
57
+ it "copies the value in `beat.hostname` to `host`" do
58
+ expect(subject.get("host")).to eq(producer_host)
59
+ end
60
+ end
61
+
62
+ context "when `host` key exists on the event" do
63
+ let(:already_exist) { "already_exist" }
64
+ let(:event_map) { super.merge({ "host" => already_exist }) }
65
+
66
+ it "doesn't override it" do
67
+ expect(subject.get("host")).to eq(already_exist)
68
+ end
69
+ end
70
+ end
71
+
72
+ context "when no host is provided in beat" do
73
+ context "when no `host` key already exists on the event" do
74
+ it "does not set the host" do
75
+ expect(subject.get("host")).to be_nil
76
+ end
77
+ end
78
+
79
+ context "when `host` key already exists on the event" do
80
+ let(:already_exist) { "already_exist" }
81
+ let(:event_map) { super.merge({ "host" => already_exist }) }
82
+
83
+ it "doesn't override it" do
84
+ expect(subject.get("host")).to eq(already_exist)
85
+ end
44
86
  end
45
87
  end
88
+ end
46
89
 
47
- context "when `host` key exists on the event" do
90
+ context 'when add hostname is false' do
91
+ let(:config) { super.merge({'add_hostname' => false})}
92
+
93
+ context 'when a host is provided in beat.host.name' do
48
94
  let(:already_exist) { "already_exist" }
49
- let(:event_map) { super.merge({ "host" => already_exist }) }
95
+ let(:producer_host) { "newhost01" }
96
+ let(:event_map) { super.merge({ "beat" => { "host" => {"name" => producer_host }}}) }
97
+
98
+ context "when no `host` key already exists on the event" do
99
+ it "does not set the host" do
100
+ expect(subject.get("host")).to be_nil
101
+ end
102
+ end
103
+
104
+ context "when `host` key already exists on the event" do
105
+ let(:already_exist) { "already_exist" }
106
+ let(:event_map) { super.merge({ "host" => already_exist }) }
107
+
108
+ it "doesn't override it" do
109
+ expect(subject.get("host")).to eq(already_exist)
110
+ end
111
+ end
112
+ end
113
+
114
+ context "when a host is provided in `beat.hostname`" do
115
+ let(:producer_host) { "newhost01" }
116
+ let(:event_map) { super.merge({ "beat" => { "hostname" => producer_host }}) }
117
+
118
+ context "when no `host` key already exists on the event" do
119
+ it "does not set the host" do
120
+ expect(subject.get("host")).to be_nil
121
+ end
122
+ end
123
+
124
+ context "when `host` key already exists on the event" do
125
+ let(:already_exist) { "already_exist" }
126
+ let(:event_map) { super.merge({ "host" => already_exist }) }
127
+
128
+ it "doesn't override it" do
129
+ expect(subject.get("host")).to eq(already_exist)
130
+ end
131
+ end
132
+ end
133
+
134
+ context "when no host is provided in beat" do
135
+ context "when no `host` key already exists on the event" do
136
+ it "does not set the host" do
137
+ expect(subject.get("host")).to be_nil
138
+ end
139
+ end
140
+
141
+ context "when `host` key already exists on the event" do
142
+ let(:already_exist) { "already_exist" }
143
+ let(:event_map) { super.merge({ "host" => already_exist }) }
50
144
 
51
- it "doesn't override it" do
52
- expect(subject.get("host")).to eq(already_exist)
145
+ it "doesn't override it" do
146
+ expect(subject.get("host")).to eq(already_exist)
147
+ end
53
148
  end
54
149
  end
55
150
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-beats
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.3
4
+ version: 5.1.4
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-20 00:00:00.000000000 Z
11
+ date: 2018-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -266,7 +266,7 @@ files:
266
266
  - vendor/jar-dependencies/io/netty/netty-tcnative-boringssl-static/2.0.7.Final/netty-tcnative-boringssl-static-2.0.7.Final.jar
267
267
  - vendor/jar-dependencies/org/apache/logging/log4j/log4j-api/2.6.2/log4j-api-2.6.2.jar
268
268
  - vendor/jar-dependencies/org/javassist/javassist/3.20.0-GA/javassist-3.20.0-GA.jar
269
- - vendor/jar-dependencies/org/logstash/beats/logstash-input-beats/5.1.3/logstash-input-beats-5.1.3.jar
269
+ - vendor/jar-dependencies/org/logstash/beats/logstash-input-beats/5.1.4/logstash-input-beats-5.1.4.jar
270
270
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
271
271
  licenses:
272
272
  - Apache License (2.0)