logstash-input-elasticsearch 4.12.1 → 4.12.2

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: e2427b28640265b075a0e21240cf410b2e2252d7516ac7bd0955d48087317f7f
4
- data.tar.gz: dbc7d84f18348e7fa2292d2b68a5db59a5ffda724eb090ff17503e10e3ff130d
3
+ metadata.gz: caea2fedebb629d87471f67b2b03f43186e7e2b02e854e3f6df7154a64316f16
4
+ data.tar.gz: 1d75f76b97d6d8ea481637399b1ea82668f5fb47ea52a2f1a51034594b55375f
5
5
  SHA512:
6
- metadata.gz: dd3f9693c355505fbe5a971a46899ba285e057406db5807d4226b4ace61449f41f20409926d49a5a69c19338020069de13e4a4da7028db9b8f7db6d3ce4e0e6c
7
- data.tar.gz: 0c170d69801feac7d0df3a79ef4351a6237fa30d5ad3b69e0c8af660981f40a1d814e17d60cebd0e555cdee6613de93c7e407d2cba28f0092f85f5da7446b966
6
+ metadata.gz: 07af682a46bc7aa7bd48b0d4c4f0a4baa9e8dd5a8848821863b67fe4b2ee5890655d76de1de782938be0b73bf3057228a94ccbf155b7fb9ecaa81077831362e5
7
+ data.tar.gz: 0031f21cc9d7e41dfdbf9de400b33e21a1b9abda7c9ca2159fb21623ff5cf21258b99670d22090eda39ad42141408166c10317874ea6682e4e3b756e031355a1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 4.12.2
2
+ - Fix: hosts => "es_host:port" regression [#168](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/168)
3
+
1
4
  ## 4.12.1
2
5
  - Fixed too_long_frame_exception by passing scroll_id in the body [#159](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/159)
3
6
 
data/Gemfile CHANGED
@@ -9,3 +9,6 @@ if Dir.exist?(logstash_path) && use_logstash_source
9
9
  gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
10
10
  gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
11
11
  end
12
+
13
+ gem 'manticore', ENV['MANTICORE_VERSION'] if ENV['MANTICORE_VERSION']
14
+ gem 'elasticsearch', ENV['ELASTICSEARCH_VERSION'] if ENV['ELASTICSEARCH_VERSION']
@@ -386,13 +386,13 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
386
386
 
387
387
  def setup_hosts
388
388
  @hosts = Array(@hosts).map { |host| host.to_s } # potential SafeURI#to_s
389
- if @ssl
390
- @hosts.map do |h|
391
- host, port = h.split(":")
392
- { :host => host, :scheme => 'https', :port => port }
389
+ @hosts.map do |h|
390
+ if h.start_with?('http:', 'https:')
391
+ h
392
+ else
393
+ host, port = h.split(':')
394
+ { host: host, port: port, scheme: (@ssl ? 'https' : 'http') }
393
395
  end
394
- else
395
- @hosts
396
396
  end
397
397
  end
398
398
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-elasticsearch'
4
- s.version = '4.12.1'
4
+ s.version = '4.12.2'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Reads query results from an Elasticsearch cluster"
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"
@@ -6,13 +6,19 @@ require_relative "../../../spec/es_helper"
6
6
 
7
7
  describe LogStash::Inputs::Elasticsearch do
8
8
 
9
- let(:config) { { 'hosts' => [ESHelper.get_host_port],
9
+ SECURE_INTEGRATION = ENV['SECURE_INTEGRATION'].eql? 'true'
10
+
11
+ let(:config) { { 'hosts' => ["http#{SECURE_INTEGRATION ? 's' : nil}://#{ESHelper.get_host_port}"],
10
12
  'index' => 'logs',
11
13
  'query' => '{ "query": { "match": { "message": "Not found"} }}' } }
12
14
  let(:plugin) { described_class.new(config) }
13
15
  let(:event) { LogStash::Event.new({}) }
14
16
  let(:client_options) { Hash.new }
15
17
 
18
+ let(:user) { ENV['ELASTIC_USER'] || 'simpleuser' }
19
+ let(:password) { ENV['ELASTIC_PASSWORD'] || 'abc123' }
20
+ let(:ca_file) { "spec/fixtures/test_certs/ca.crt" }
21
+
16
22
  before(:each) do
17
23
  @es = ESHelper.get_client(client_options)
18
24
  # Delete all templates first.
@@ -45,7 +51,7 @@ describe LogStash::Inputs::Elasticsearch do
45
51
  end
46
52
  end
47
53
 
48
- describe 'against an unsecured elasticsearch', :integration => true do
54
+ describe 'against an unsecured elasticsearch', integration: true do
49
55
  before(:each) do
50
56
  plugin.register
51
57
  end
@@ -53,10 +59,7 @@ describe LogStash::Inputs::Elasticsearch do
53
59
  it_behaves_like 'an elasticsearch index plugin'
54
60
  end
55
61
 
56
- describe 'against a secured elasticsearch', :secure_integration => true do
57
- let(:user) { ENV['ELASTIC_USER'] || 'simpleuser' }
58
- let(:password) { ENV['ELASTIC_PASSWORD'] || 'abc123' }
59
- let(:ca_file) { "spec/fixtures/test_certs/ca.crt" }
62
+ describe 'against a secured elasticsearch', secure_integration: true do
60
63
 
61
64
  let(:client_options) { { :ca_file => ca_file, :user => user, :password => password } }
62
65
 
@@ -78,4 +81,28 @@ describe LogStash::Inputs::Elasticsearch do
78
81
  end
79
82
 
80
83
  end
84
+
85
+ context 'setting host:port', integration: true do
86
+
87
+ let(:config) do
88
+ super().merge "hosts" => [ESHelper.get_host_port]
89
+ end
90
+
91
+ it_behaves_like 'an elasticsearch index plugin'
92
+
93
+ end
94
+
95
+ context 'setting host:port (and ssl)', secure_integration: true do
96
+
97
+ let(:client_options) { { :ca_file => ca_file, :user => user, :password => password } }
98
+
99
+ let(:config) do
100
+ config = super().merge "hosts" => [ESHelper.get_host_port]
101
+ config.merge('user' => user, 'password' => password, 'ssl' => true, 'ca_file' => ca_file)
102
+ end
103
+
104
+ it_behaves_like 'an elasticsearch index plugin'
105
+
106
+ end
107
+
81
108
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.12.1
4
+ version: 4.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-15 00:00:00.000000000 Z
11
+ date: 2022-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement