logstash-core 6.8.0-java → 6.8.1-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: 5071f9304b6a23e209a8066521865d09ee9235ca69e027fdf54ab277113f94bb
4
- data.tar.gz: c69a7b8aa2caf0739b191bd517dbc9e002757a251173bc6d1454525745ff5b42
3
+ metadata.gz: fe13d725f9d7adab06d6e1cd7c194022986600a18886c70ba7e226fa3404be63
4
+ data.tar.gz: 6756c01d8c5003b8566288e73d2da68ba453e2dede4bb88751ecdf8bf8b37770
5
5
  SHA512:
6
- metadata.gz: e8dcc896f404b3979054fb5335529e923479c6907f14097b10833a52026d9e1cd00c8bb461756565b19b3d96965448198335c377e313bc2cf58face22927b5e7
7
- data.tar.gz: 9d790ea80dcd354bfdbe6b684c0fe395077796a4c2103a72f1061752c9e8d87a588de7e7ba42f5bd2410f2439f288c10bcf4175a6b993aadb6b0add3b5281fec
6
+ metadata.gz: 0fb880c7824d5e3f024ccb820dcd2e727ee6b3460ac32cfbdcace8eddcf696247be130cb3020ed5b4ba35afb5fa81f62b92ec8b9b67cb8985222faed76833c91
7
+ data.tar.gz: b700e79cbc1ecc9c9f08caa333b9ffb8c0298305f03f53889e28ecd4e22a32c7dbdd3f1798d2be9217bffa5798d078867da0990038e71157c7b060651f53aa1a
@@ -3,6 +3,7 @@ require "treetop"
3
3
  require "logstash/compiler/treetop_monkeypatches"
4
4
  require "logstash/compiler/lscl/helpers"
5
5
  require "logstash/config/string_escape"
6
+ require "logstash/util"
6
7
 
7
8
  java_import org.logstash.config.ir.DSL
8
9
  java_import org.logstash.common.SourceWithMetadata
@@ -111,7 +112,7 @@ module LogStashCompilerLSCLGrammar; module LogStash; module Compiler; module LSC
111
112
  # hash value; e.g., `{"match" => {"baz" => "bar"}, "match" => {"foo" => "bulb"}}` is
112
113
  # interpreted as `{"match" => {"baz" => "bar", "foo" => "blub"}}`.
113
114
  # (NOTE: this bypasses `AST::Hash`'s ability to detect duplicate keys)
114
- hash[k] = existing.merge(v)
115
+ hash[k] = ::LogStash::Util.hash_merge_many(existing, v)
115
116
  elsif existing.kind_of?(::Array)
116
117
  hash[k] = existing.push(*v)
117
118
  else
@@ -164,8 +165,8 @@ module LogStashCompilerLSCLGrammar; module LogStash; module Compiler; module LSC
164
165
  class Number < Value
165
166
  def expr
166
167
  jdsl.eValue(source_meta, text_value.include?(".") ?
167
- text_value.to_f :
168
- text_value.to_i)
168
+ Float(text_value) :
169
+ Integer(text_value))
169
170
  end
170
171
  end
171
172
 
@@ -164,11 +164,15 @@ module LogStash
164
164
  end
165
165
 
166
166
  def windows?
167
- RbConfig::CONFIG['host_os'] =~ WINDOW_OS_RE
167
+ host_os =~ WINDOW_OS_RE
168
168
  end
169
169
 
170
170
  def linux?
171
- RbConfig::CONFIG['host_os'] =~ LINUX_OS_RE
171
+ host_os =~ LINUX_OS_RE
172
+ end
173
+
174
+ def host_os
175
+ RbConfig::CONFIG['host_os']
172
176
  end
173
177
 
174
178
  def locales_path(path)
@@ -252,6 +252,34 @@ describe LogStash::Compiler do
252
252
  expect(c_plugin).to ir_eql(j.iPlugin(rand_meta, FILTER, "grok", expected_plugin_args))
253
253
  end
254
254
 
255
+ describe "a filter plugin with a repeated hash directive with duplicated keys" do
256
+ let(:source) { "input { } filter { #{plugin_source} } output { } " }
257
+ let(:plugin_source) do
258
+ %q[
259
+ grok {
260
+ match => { "message" => "foo" }
261
+ match => { "message" => "bar" }
262
+ break_on_match => false
263
+ }
264
+ ]
265
+ end
266
+ subject(:c_plugin) { compiled[:filter] }
267
+
268
+ let(:expected_plugin_args) do
269
+ {
270
+ "match" => {
271
+ "message" => ["foo", "bar"]
272
+ },
273
+ "break_on_match" => "false"
274
+ }
275
+ end
276
+
277
+ it "should merge the values of the duplicate keys into an array" do
278
+ expect(c_plugin).to ir_eql(j.iPlugin(rand_meta, FILTER, "grok", expected_plugin_args))
279
+ end
280
+
281
+ end
282
+
255
283
  describe "a filter plugin that has nested Hash directives" do
256
284
  let(:source) { "input { } filter { #{plugin_source} } output { } " }
257
285
  let(:plugin_source) do
@@ -143,6 +143,21 @@ describe LogStashConfigParser do
143
143
 
144
144
  expect(config).to be_nil
145
145
  end
146
+
147
+ it "supports octal literals" do
148
+ parser = LogStashConfigParser.new
149
+ config = parser.parse(%q(
150
+ input {
151
+ example {
152
+ foo => 010
153
+ }
154
+ }
155
+ ))
156
+
157
+ compiled_number = eval(config.recursive_select(LogStash::Config::AST::Number).first.compile)
158
+
159
+ expect(compiled_number).to be == 8
160
+ end
146
161
  end
147
162
 
148
163
  context "when config.support_escapes" do
@@ -57,14 +57,14 @@ describe LogStash::Environment do
57
57
  context "windows" do
58
58
  windows_host_os.each do |host|
59
59
  it "#{host} returns true" do
60
- expect(RbConfig::CONFIG).to receive(:[]).with("host_os").and_return(host)
60
+ allow(LogStash::Environment).to receive(:host_os).and_return(host)
61
61
  expect(LogStash::Environment.windows?).to be_truthy
62
62
  end
63
63
  end
64
64
 
65
65
  linux_host_os.each do |host|
66
66
  it "#{host} returns false" do
67
- expect(RbConfig::CONFIG).to receive(:[]).with("host_os").and_return(host)
67
+ allow(LogStash::Environment).to receive(:host_os).and_return(host)
68
68
  expect(LogStash::Environment.windows?).to be_falsey
69
69
  end
70
70
  end
@@ -73,14 +73,14 @@ describe LogStash::Environment do
73
73
  context "Linux" do
74
74
  windows_host_os.each do |host|
75
75
  it "#{host} returns true" do
76
- expect(RbConfig::CONFIG).to receive(:[]).with("host_os").and_return(host)
76
+ allow(LogStash::Environment).to receive(:host_os).and_return(host)
77
77
  expect(LogStash::Environment.linux?).to be_falsey
78
78
  end
79
79
  end
80
80
 
81
81
  linux_host_os.each do |host|
82
82
  it "#{host} returns false" do
83
- expect(RbConfig::CONFIG).to receive(:[]).with("host_os").and_return(host)
83
+ allow(LogStash::Environment).to receive(:host_os).and_return(host)
84
84
  expect(LogStash::Environment.linux?).to be_truthy
85
85
  end
86
86
  end
@@ -1,6 +1,6 @@
1
1
  ---
2
- logstash: 6.8.0
3
- logstash-core: 6.8.0
2
+ logstash: 6.8.1
3
+ logstash-core: 6.8.1
4
4
  logstash-core-plugin-api: 2.1.16
5
5
 
6
6
  # jruby must reference a *released* version of jruby which can be downloaded from the official download url
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.8.0
4
+ version: 6.8.1
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-15 00:00:00.000000000 Z
11
+ date: 2019-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement