logstash-output-elasticsearch 7.3.2-java → 7.3.3-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42a74efb39e22b7169dc0ff278c364b1b6b8f282
4
- data.tar.gz: 703b6a84b574bd8db99dd8dabb1fa16c77b34eb3
3
+ metadata.gz: dc9b9269ae5cb7c813b4285f847b8ccd8f05ac36
4
+ data.tar.gz: 7d35c24ff12143617a196b8ac58533b792bfea84
5
5
  SHA512:
6
- metadata.gz: f0bc0d68d637ee45d5b2a4243f03f72ce367dc34c81f4366b16c46ee9da3034d7d42799d90b518663ee894eb5bf59110a9530d8a35ab259bab047335ac3200f4
7
- data.tar.gz: 5d6d9edc56c353d3ea1350a54ff1142d0af0242c587d54a6a26b646b9fd54bfef939f8925d346e0e25e0d78c0ab487df6419c899c6b7e2ed410e21233099c27e
6
+ metadata.gz: e47d9eb0b7b17c372374f0b326f3e22c5969c496364b0a735c7909a7afb4f085723bb356bbc5f5866b85992d3fe7c2f90dcb28082ba1414621a213dce87597c6
7
+ data.tar.gz: 154d3cee1472d12d47fe39b21eb17403618b19d2a5f515805b7625e3198879f06738fd751b449ebc4e3c3e0bf141d5069db867c3265226c4b1375b27042b554b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 7.3.3
2
+ - Fix JRuby 9k incompatibilities and use new URI class that is JRuby 9k compatible
3
+
1
4
  ## 7.3.2
2
5
  - Fix error where a 429 would cause this output to crash
3
6
  - Wait for all inflight requests to complete before stopping
data/Gemfile CHANGED
@@ -2,9 +2,10 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- logstash_path = "../../logstash"
5
+ logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
6
+ use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
6
7
 
7
- if Dir.exist?(logstash_path) && ENV["LOGSTASH_SOURCE"] == 1
8
+ if Dir.exist?(logstash_path) && use_logstash_source
8
9
  gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
9
10
  gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
10
11
  end
@@ -84,19 +84,19 @@ module LogStash; module Outputs; class ElasticSearch; class HttpClient;
84
84
  end
85
85
 
86
86
  def format_url(url, path=nil)
87
-
88
- request_uri = url.uri
87
+ request_uri = url.clone
89
88
 
90
89
  if path
91
90
  # Combine the paths using the minimal # of /s
92
91
  # First, we make sure the path is relative so URI.join does
93
92
  # the right thing
94
93
  relative_path = path && path.start_with?("/") ? path[1..-1] : path
95
- # because URI.join obliterates the query parameter, we need to save it
96
- # and restore it after this operation
97
- query = request_uri.query
98
- request_uri = URI.join(request_uri, relative_path)
99
- request_uri.query = query if query
94
+
95
+ if !request_uri.path
96
+ request_uri.path = path
97
+ else
98
+ request_uri.path = "#{request_uri.path}/#{relative_path}"
99
+ end
100
100
  else
101
101
  request_uri = request_uri.clone
102
102
  end
@@ -106,8 +106,7 @@ module LogStash; module Outputs; class ElasticSearch; class HttpClient;
106
106
  request_uri.user = nil
107
107
  request_uri.password = nil
108
108
 
109
- # Wrap this with a safe URI defensively against careless handling later
110
- ::LogStash::Util::SafeURI.new(request_uri)
109
+ request_uri
111
110
  end
112
111
 
113
112
  def close
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-elasticsearch'
3
- s.version = '7.3.2'
3
+ s.version = '7.3.3'
4
4
  s.licenses = ['apache-2.0']
5
5
  s.summary = "Logstash Output to Elasticsearch"
6
6
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -19,15 +19,19 @@ describe LogStash::Outputs::ElasticSearch::HttpClient::ManticoreAdapter do
19
19
  describe "auth" do
20
20
  let(:user) { "myuser" }
21
21
  let(:password) { "mypassword" }
22
- let(:noauth_uri) { clone = uri.uri.clone;clone.user=nil; clone.password=nil; clone.to_s }
22
+ let(:noauth_uri) { clone = uri.clone; clone.user=nil; clone.password=nil; clone }
23
23
  let(:uri) { ::LogStash::Util::SafeURI.new("http://#{user}:#{password}@localhost:9200") }
24
24
 
25
25
  it "should convert the auth to params" do
26
26
  resp = double("response")
27
27
  allow(resp).to receive(:call)
28
28
  allow(resp).to receive(:code).and_return(200)
29
+
30
+ expected_uri = noauth_uri.clone
31
+ expected_uri.path = "/"
32
+
29
33
  expect(subject.manticore).to receive(:get).
30
- with(noauth_uri, {
34
+ with(expected_uri.to_s, {
31
35
  :headers => {"Content-Type" => "application/json"},
32
36
  :auth => {
33
37
  :user => user,
@@ -46,7 +50,7 @@ describe LogStash::Outputs::ElasticSearch::HttpClient::ManticoreAdapter do
46
50
  subject { described_class.new(double("logger"), {}) }
47
51
 
48
52
  it "should add the path argument to the uri's path" do
49
- expect(subject.format_url(url, path).path).to eq("/path/_bulk")
53
+ expect(subject.format_url(url, path).path).to eq("/path//_bulk")
50
54
  end
51
55
 
52
56
  context "when uri contains query parameters" do
@@ -59,7 +63,7 @@ describe LogStash::Outputs::ElasticSearch::HttpClient::ManticoreAdapter do
59
63
  end
60
64
 
61
65
  context "when uri contains credentials" do
62
- let(:url) { ::LogStash::Util::SafeURI.new("http://user:pass@localhost:9200") }
66
+ let(:url) { ::LogStash::Util::SafeURI.new("http://myuser:mypass@localhost:9200") }
63
67
 
64
68
  it "should remove credentials after format" do
65
69
  expect(subject.format_url(url, path).user).to be_nil
@@ -32,7 +32,7 @@ describe LogStash::Outputs::ElasticSearch::HttpClient do
32
32
 
33
33
  shared_examples("proper host handling") do
34
34
  it "should properly transform a host:port string to a URL" do
35
- expect(subject.host_to_url(hostname_port_uri)).to eq(http_hostname_port)
35
+ expect(subject.host_to_url(hostname_port_uri).to_s).to eq(http_hostname_port.to_s + "/")
36
36
  end
37
37
 
38
38
  it "should not raise an error with a / for a path" do
@@ -40,7 +40,7 @@ describe LogStash::Outputs::ElasticSearch::HttpClient do
40
40
  end
41
41
 
42
42
  it "should parse full URLs correctly" do
43
- expect(subject.host_to_url(http_hostname_port)).to eq(http_hostname_port)
43
+ expect(subject.host_to_url(http_hostname_port).to_s).to eq(http_hostname_port.to_s + "/")
44
44
  end
45
45
 
46
46
  describe "ssl" do
@@ -70,7 +70,7 @@ describe LogStash::Outputs::ElasticSearch::HttpClient do
70
70
  let(:base_options) { super.merge(:hosts => [https_hostname_port]) }
71
71
  it "should handle an ssl url correctly when SSL is nil" do
72
72
  subject
73
- expect(subject.host_to_url(https_hostname_port)).to eq(https_hostname_port)
73
+ expect(subject.host_to_url(https_hostname_port).to_s).to eq(https_hostname_port.to_s + "/")
74
74
  end
75
75
  end
76
76
  end
@@ -99,7 +99,9 @@ describe LogStash::Outputs::ElasticSearch::HttpClient do
99
99
 
100
100
 
101
101
  it "should automatically insert a / in front of path overlays" do
102
- expect(subject.host_to_url(url)).to eq(LogStash::Util::SafeURI.new(url + "/otherpath"))
102
+ expected = url.clone
103
+ expected.path = url.path + "/otherpath"
104
+ expect(subject.host_to_url(url)).to eq(expected)
103
105
  end
104
106
  end
105
107
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.2
4
+ version: 7.3.3
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-26 00:00:00.000000000 Z
11
+ date: 2017-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement