logstash-output-elasticsearch 2.7.1-java → 3.0.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 +4 -4
- data/CHANGELOG.md +4 -6
- data/Gemfile +2 -1
- data/lib/logstash/outputs/elasticsearch/common.rb +5 -3
- data/lib/logstash/outputs/elasticsearch/http_client_builder.rb +2 -6
- data/lib/logstash/outputs/elasticsearch.rb +1 -3
- data/logstash-output-elasticsearch.gemspec +2 -2
- data/spec/integration/outputs/routing_spec.rb +1 -1
- data/spec/integration/outputs/templates_spec.rb +3 -1
- data/spec/integration/outputs/update_spec.rb +1 -2
- data/spec/unit/outputs/elasticsearch_spec.rb +2 -54
- metadata +4 -4
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: f948e5caa196ea3ba4eb76f706c65f81670189b4
         | 
| 4 | 
            +
              data.tar.gz: e8a600c78977584ce8a19f881f1dc462e1340ba5
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 1c167b9448ec63baecb93bacecbdac5fbef4f005d39121700a51579a51f742e6827f93f12552c36c2ee2b18f3bb5033c4be3ab1b0f8b242e71c27b14088b040d
         | 
| 7 | 
            +
              data.tar.gz: f579359b3b18ecbf4fbdc86559a077ce306df472bd9c0e961882fc604c32ef0e2d3b7c28386af37c14687529e8fc8f03aa34f00a36d980c550f876efa8465d2f
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,9 +1,7 @@ | |
| 1 | 
            -
            ##  | 
| 2 | 
            -
             | 
| 3 | 
            -
              | 
| 4 | 
            -
             | 
| 5 | 
            -
             - Allow URI paths to work correctly when no 'path' option set
         | 
| 6 | 
            -
             | 
| 1 | 
            +
            ## 3.0.1
         | 
| 2 | 
            +
              - Republish all the gems under jruby.
         | 
| 3 | 
            +
            ## 3.0.0
         | 
| 4 | 
            +
              - Update the plugin to the version 2.0 of the plugin api, this change is required for Logstash 5.0 compatibility. See https://github.com/elastic/logstash/issues/5141
         | 
| 7 5 | 
             
            ## 2.7.0
         | 
| 8 6 | 
             
             - Add `pipeline` configuration option for setting an ingest pipeline to run upon indexing
         | 
| 9 7 |  | 
    
        data/Gemfile
    CHANGED
    
    
| @@ -157,7 +157,7 @@ module LogStash; module Outputs; class ElasticSearch; | |
| 157 157 | 
             
                  type = if @document_type
         | 
| 158 158 | 
             
                           event.sprintf(@document_type)
         | 
| 159 159 | 
             
                         else
         | 
| 160 | 
            -
                           event | 
| 160 | 
            +
                           event.get("type") || "logs"
         | 
| 161 161 | 
             
                         end
         | 
| 162 162 |  | 
| 163 163 | 
             
                  if !(type.is_a?(String) || type.is_a?(Numeric))
         | 
| @@ -177,7 +177,8 @@ module LogStash; module Outputs; class ElasticSearch; | |
| 177 177 | 
             
                    "Attempted to send a bulk request to Elasticsearch configured at '#{@client.client_options[:hosts]}',"+
         | 
| 178 178 | 
             
                      " but Elasticsearch appears to be unreachable or down!",
         | 
| 179 179 | 
             
                    :error_message => e.message,
         | 
| 180 | 
            -
                    :class => e.class.name
         | 
| 180 | 
            +
                    :class => e.class.name,
         | 
| 181 | 
            +
                    :client_config => @client.client_options,
         | 
| 181 182 | 
             
                  )
         | 
| 182 183 | 
             
                  @logger.debug("Failed actions for last bad bulk request!", :actions => actions)
         | 
| 183 184 |  | 
| @@ -192,7 +193,8 @@ module LogStash; module Outputs; class ElasticSearch; | |
| 192 193 | 
             
                      "the configuration provided?",
         | 
| 193 194 | 
             
                    :error_message => e.message,
         | 
| 194 195 | 
             
                    :error_class => e.class.name,
         | 
| 195 | 
            -
                    :backtrace => e.backtrace
         | 
| 196 | 
            +
                    :backtrace => e.backtrace,
         | 
| 197 | 
            +
                    :client_config => @client.client_options,
         | 
| 196 198 | 
             
                  )
         | 
| 197 199 |  | 
| 198 200 | 
             
                  @logger.debug("Failed actions for last bad bulk request!", :actions => actions)
         | 
| @@ -10,11 +10,7 @@ module LogStash; module Outputs; class ElasticSearch; | |
| 10 10 | 
             
                  }
         | 
| 11 11 |  | 
| 12 12 | 
             
                  common_options[:timeout] = params["timeout"] if params["timeout"]
         | 
| 13 | 
            -
             | 
| 14 | 
            -
                  if params["path"]
         | 
| 15 | 
            -
                    client_settings[:path] = "/#{params["path"]}/".gsub(/\/+/, "/") # Normalize slashes
         | 
| 16 | 
            -
                  end
         | 
| 17 | 
            -
             | 
| 13 | 
            +
                  client_settings[:path] = "/#{params["path"]}/".gsub(/\/+/, "/") # Normalize slashes
         | 
| 18 14 | 
             
                  logger.debug? && logger.debug("Normalizing http path", :path => params["path"], :normalized => client_settings[:path])
         | 
| 19 15 |  | 
| 20 16 | 
             
                  client_settings.merge! setup_ssl(logger, params)
         | 
| @@ -107,4 +103,4 @@ module LogStash; module Outputs; class ElasticSearch; | |
| 107 103 | 
             
                  }
         | 
| 108 104 | 
             
                end
         | 
| 109 105 | 
             
              end
         | 
| 110 | 
            -
            end; end; end
         | 
| 106 | 
            +
            end; end; end
         | 
| @@ -79,9 +79,7 @@ class LogStash::Outputs::ElasticSearch < LogStash::Outputs::Base | |
| 79 79 |  | 
| 80 80 | 
             
              # HTTP Path at which the Elasticsearch server lives. Use this if you must run Elasticsearch behind a proxy that remaps
         | 
| 81 81 | 
             
              # the root path for the Elasticsearch HTTP API lives.
         | 
| 82 | 
            -
               | 
| 83 | 
            -
              # not also set this field. That will raise an error at startup
         | 
| 84 | 
            -
              config :path, :validate => :string
         | 
| 82 | 
            +
              config :path, :validate => :string, :default => "/"
         | 
| 85 83 |  | 
| 86 84 | 
             
              # Enable SSL/TLS secured communication to Elasticsearch cluster. Leaving this unspecified will use whatever scheme
         | 
| 87 85 | 
             
              # is specified in the URLs listed in 'hosts'. If no explicit protocol is specified plain HTTP will be used.
         | 
| @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            Gem::Specification.new do |s|
         | 
| 2 2 |  | 
| 3 3 | 
             
              s.name            = 'logstash-output-elasticsearch'
         | 
| 4 | 
            -
              s.version         = ' | 
| 4 | 
            +
              s.version         = '3.0.1'
         | 
| 5 5 | 
             
              s.licenses        = ['apache-2.0']
         | 
| 6 6 | 
             
              s.summary         = "Logstash Output to Elasticsearch"
         | 
| 7 7 | 
             
              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"
         | 
| @@ -24,7 +24,7 @@ Gem::Specification.new do |s| | |
| 24 24 | 
             
              s.add_runtime_dependency 'elasticsearch', ['>= 1.0.13', '~> 1.0']
         | 
| 25 25 | 
             
              s.add_runtime_dependency 'stud', ['>= 0.0.17', '~> 0.0']
         | 
| 26 26 | 
             
              s.add_runtime_dependency 'cabin', ['~> 0.6']
         | 
| 27 | 
            -
              s.add_runtime_dependency "logstash-core-plugin-api", "~>  | 
| 27 | 
            +
              s.add_runtime_dependency "logstash-core-plugin-api", "~> 2.0"
         | 
| 28 28 |  | 
| 29 29 | 
             
              s.add_development_dependency 'ftw', '~> 0.0.42'
         | 
| 30 30 | 
             
              s.add_development_dependency 'logstash-codec-plain'
         | 
| @@ -12,7 +12,7 @@ shared_examples "a routing indexer" do | |
| 12 12 | 
             
                before do
         | 
| 13 13 | 
             
                  subject.register
         | 
| 14 14 | 
             
                  event_count.times do
         | 
| 15 | 
            -
                    subject.receive(LogStash::Event.new("message" => " | 
| 15 | 
            +
                    subject.receive(LogStash::Event.new("message" => "Hello World!", "type" => type))
         | 
| 16 16 | 
             
                  end
         | 
| 17 17 | 
             
                end
         | 
| 18 18 |  | 
| @@ -73,7 +73,9 @@ describe "index template expected behavior", :integration => true do | |
| 73 73 | 
             
              end
         | 
| 74 74 |  | 
| 75 75 | 
             
              it "make [geoip][location] a geo_point" do
         | 
| 76 | 
            -
                 | 
| 76 | 
            +
                results = @es.search(:body => { "query" => { "bool" => { "must" => { "match_all" => {} }, "filter" => { "geo_distance" => { "distance" => "1000km", "geoip.location" => { "lat" => 0.5, "lon" => 0.5 } } } } } })
         | 
| 77 | 
            +
                insist { results["hits"]["total"] } == 1
         | 
| 78 | 
            +
                insist { results["hits"]["hits"][0]["_source"]["geoip"]["location"] } == [ 0.0, 0.0 ]
         | 
| 77 79 | 
             
              end
         | 
| 78 80 |  | 
| 79 81 | 
             
              it "aggregate .raw results correctly " do
         | 
| @@ -18,12 +18,10 @@ describe "outputs/elasticsearch" do | |
| 18 18 | 
             
                  eso.client.send(:client).transport.options[:hosts].first
         | 
| 19 19 | 
             
                }
         | 
| 20 20 |  | 
| 21 | 
            -
                let(:do_register) { true }
         | 
| 22 | 
            -
             | 
| 23 21 | 
             
                around(:each) do |block|
         | 
| 24 | 
            -
                  eso.register | 
| 22 | 
            +
                  eso.register
         | 
| 25 23 | 
             
                  block.call()
         | 
| 26 | 
            -
                  eso.close | 
| 24 | 
            +
                  eso.close
         | 
| 27 25 | 
             
                end
         | 
| 28 26 |  | 
| 29 27 | 
             
                describe "getting a document type" do
         | 
| @@ -80,56 +78,6 @@ describe "outputs/elasticsearch" do | |
| 80 78 | 
             
                      expect(manticore_host).to include(options["path"])
         | 
| 81 79 | 
             
                    end
         | 
| 82 80 | 
             
                  end
         | 
| 83 | 
            -
             | 
| 84 | 
            -
                  context "with a URI based path" do
         | 
| 85 | 
            -
                    let(:options) do
         | 
| 86 | 
            -
                      o = super()
         | 
| 87 | 
            -
                      o.delete("path")
         | 
| 88 | 
            -
                      o["hosts"] = ["http://localhost:9200/mypath/"]
         | 
| 89 | 
            -
                      o
         | 
| 90 | 
            -
                    end
         | 
| 91 | 
            -
                    let(:client_host_path) { URI.parse(eso.client.client_options[:hosts].first).path }
         | 
| 92 | 
            -
             | 
| 93 | 
            -
                    it "should initialize without error" do
         | 
| 94 | 
            -
                      expect { eso }.not_to raise_error
         | 
| 95 | 
            -
                    end
         | 
| 96 | 
            -
             | 
| 97 | 
            -
                    it "should use the URI path" do
         | 
| 98 | 
            -
                      expect(client_host_path).to eql("/mypath/")
         | 
| 99 | 
            -
                    end
         | 
| 100 | 
            -
             | 
| 101 | 
            -
                    context "with a path option but no URL path" do
         | 
| 102 | 
            -
                      let(:options) do
         | 
| 103 | 
            -
                        o = super()
         | 
| 104 | 
            -
                        o["path"] = "/override/"
         | 
| 105 | 
            -
                        o["hosts"] = ["http://localhost:9200"]
         | 
| 106 | 
            -
                        o
         | 
| 107 | 
            -
                      end
         | 
| 108 | 
            -
             | 
| 109 | 
            -
                      it "should initialize without error" do
         | 
| 110 | 
            -
                        expect { eso }.not_to raise_error
         | 
| 111 | 
            -
                      end
         | 
| 112 | 
            -
             | 
| 113 | 
            -
                      it "should use the option path" do
         | 
| 114 | 
            -
                        expect(client_host_path).to eql("/override/")
         | 
| 115 | 
            -
                      end
         | 
| 116 | 
            -
                    end
         | 
| 117 | 
            -
             | 
| 118 | 
            -
                    # If you specify the path in two spots that is an error!
         | 
| 119 | 
            -
                    context "with a path option and a URL path" do
         | 
| 120 | 
            -
                      let(:do_register) { false } # Register will fail
         | 
| 121 | 
            -
                      let(:options) do
         | 
| 122 | 
            -
                        o = super()
         | 
| 123 | 
            -
                        o["path"] = "/override"
         | 
| 124 | 
            -
                        o["hosts"] = ["http://localhost:9200/mypath/"]
         | 
| 125 | 
            -
                        o
         | 
| 126 | 
            -
                      end
         | 
| 127 | 
            -
             | 
| 128 | 
            -
                      it "should initialize with an error" do
         | 
| 129 | 
            -
                        expect { eso.register }.to raise_error(LogStash::ConfigurationError)
         | 
| 130 | 
            -
                      end
         | 
| 131 | 
            -
                    end
         | 
| 132 | 
            -
                  end
         | 
| 133 81 | 
             
                end
         | 
| 134 82 | 
             
                describe "without a port specified" do
         | 
| 135 83 | 
             
                  it "should properly set the default port (9200) on the HTTP client" do
         | 
    
        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:  | 
| 4 | 
            +
              version: 3.0.1
         | 
| 5 5 | 
             
            platform: java
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Elastic
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2016- | 
| 11 | 
            +
            date: 2016-05-09 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -83,7 +83,7 @@ dependencies: | |
| 83 83 | 
             
                requirements:
         | 
| 84 84 | 
             
                - - "~>"
         | 
| 85 85 | 
             
                  - !ruby/object:Gem::Version
         | 
| 86 | 
            -
                    version: ' | 
| 86 | 
            +
                    version: '2.0'
         | 
| 87 87 | 
             
              name: logstash-core-plugin-api
         | 
| 88 88 | 
             
              prerelease: false
         | 
| 89 89 | 
             
              type: :runtime
         | 
| @@ -91,7 +91,7 @@ dependencies: | |
| 91 91 | 
             
                requirements:
         | 
| 92 92 | 
             
                - - "~>"
         | 
| 93 93 | 
             
                  - !ruby/object:Gem::Version
         | 
| 94 | 
            -
                    version: ' | 
| 94 | 
            +
                    version: '2.0'
         | 
| 95 95 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 96 96 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 97 97 | 
             
                requirements:
         |