logstash-output-elasticsearch 7.3.2-java → 7.3.3-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 +4 -4
 - data/CHANGELOG.md +3 -0
 - data/Gemfile +3 -2
 - data/lib/logstash/outputs/elasticsearch/http_client/manticore_adapter.rb +8 -9
 - data/logstash-output-elasticsearch.gemspec +1 -1
 - data/spec/unit/outputs/elasticsearch/http_client/manticore_adapter_spec.rb +8 -4
 - data/spec/unit/outputs/elasticsearch/http_client_spec.rb +6 -4
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: dc9b9269ae5cb7c813b4285f847b8ccd8f05ac36
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 7d35c24ff12143617a196b8ac58533b792bfea84
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: e47d9eb0b7b17c372374f0b326f3e22c5969c496364b0a735c7909a7afb4f085723bb356bbc5f5866b85992d3fe7c2f90dcb28082ba1414621a213dce87597c6
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 154d3cee1472d12d47fe39b21eb17403618b19d2a5f515805b7625e3198879f06738fd751b449ebc4e3c3e0bf141d5069db867c3265226c4b1375b27042b554b
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        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) &&  
     | 
| 
      
 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 
     | 
    
         
            -
             
     | 
| 
       96 
     | 
    
         
            -
                     
     | 
| 
       97 
     | 
    
         
            -
             
     | 
| 
       98 
     | 
    
         
            -
                     
     | 
| 
       99 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
    
         
            -
                   
     | 
| 
       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. 
     | 
| 
      
 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. 
     | 
| 
      
 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( 
     | 
| 
      
 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 
     | 
| 
      
 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:// 
     | 
| 
      
 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 
     | 
    
         
            -
                         
     | 
| 
      
 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. 
     | 
| 
      
 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 
     | 
| 
      
 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
         
     |