logstash-integration-elastic_enterprise_search 2.2.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +10 -0
- data/lib/logstash/outputs/elastic_app_search.rb +45 -81
- data/lib/logstash/outputs/elastic_workplace_search.rb +67 -37
- data/lib/logstash/plugin_mixins/enterprise_search/client.rb +35 -0
- data/lib/logstash/plugin_mixins/enterprise_search/manticore_transport.rb +84 -0
- data/lib/logstash/plugin_mixins/enterprise_search/ssl_configs.rb +32 -0
- data/logstash-integration-elastic_enterprise_search.gemspec +3 -4
- data/spec/fixtures/certificates/generate.sh +10 -0
- data/spec/fixtures/certificates/root_ca.crt +34 -0
- data/spec/fixtures/certificates/root_ca.key +52 -0
- data/spec/fixtures/certificates/root_keystore.jks +0 -0
- data/spec/fixtures/certificates/root_untrusted_ca.crt +34 -0
- data/spec/fixtures/certificates/root_untrusted_keystore.jks +0 -0
- data/spec/fixtures/certificates/root_untrusted_keystore.p12 +0 -0
- data/spec/integration/outputs/elastic_app_search_spec.rb +133 -105
- data/spec/integration/outputs/elastic_workplace_search_spec.rb +162 -95
- data/spec/unit/outputs/client_spec.rb +26 -0
- data/spec/unit/outputs/elastic_app_search_spec.rb +117 -0
- data/spec/unit/outputs/elastic_workplace_search_spec.rb +117 -0
- data/spec/unit/outputs/manticore_transport_spec.rb +124 -0
- metadata +50 -35
- data/spec/unit/outputs/appsearch_spec.rb +0 -64
metadata
CHANGED
@@ -1,85 +1,77 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-integration-elastic_enterprise_search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: '
|
19
|
-
name:
|
18
|
+
version: '0.8'
|
19
|
+
name: manticore
|
20
20
|
prerelease: false
|
21
21
|
type: :runtime
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
requirement: !ruby/object:Gem::Requirement
|
29
|
-
requirements:
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '0'
|
33
|
-
name: logstash-codec-plain
|
34
|
-
prerelease: false
|
35
|
-
type: :runtime
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
26
|
+
version: '0.8'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
requirement: !ruby/object:Gem::Requirement
|
43
29
|
requirements:
|
44
30
|
- - "~>"
|
45
31
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
47
|
-
name:
|
32
|
+
version: '2.0'
|
33
|
+
name: logstash-core-plugin-api
|
48
34
|
prerelease: false
|
49
35
|
type: :runtime
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
38
|
- - "~>"
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
40
|
+
version: '2.0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
requirement: !ruby/object:Gem::Requirement
|
57
43
|
requirements:
|
58
|
-
- - "
|
44
|
+
- - ">="
|
59
45
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
61
|
-
name:
|
46
|
+
version: '0'
|
47
|
+
name: logstash-codec-plain
|
62
48
|
prerelease: false
|
63
49
|
type: :runtime
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- - "
|
52
|
+
- - ">="
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
54
|
+
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
requirement: !ruby/object:Gem::Requirement
|
71
57
|
requirements:
|
72
|
-
- - "
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '7.16'
|
61
|
+
- - "<"
|
73
62
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
75
|
-
name: elastic-
|
63
|
+
version: '9'
|
64
|
+
name: elastic-enterprise-search
|
76
65
|
prerelease: false
|
77
66
|
type: :runtime
|
78
67
|
version_requirements: !ruby/object:Gem::Requirement
|
79
68
|
requirements:
|
80
|
-
- - "
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '7.16'
|
72
|
+
- - "<"
|
81
73
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
74
|
+
version: '9'
|
83
75
|
- !ruby/object:Gem::Dependency
|
84
76
|
requirement: !ruby/object:Gem::Requirement
|
85
77
|
requirements:
|
@@ -125,10 +117,23 @@ files:
|
|
125
117
|
- README.md
|
126
118
|
- lib/logstash/outputs/elastic_app_search.rb
|
127
119
|
- lib/logstash/outputs/elastic_workplace_search.rb
|
120
|
+
- lib/logstash/plugin_mixins/enterprise_search/client.rb
|
121
|
+
- lib/logstash/plugin_mixins/enterprise_search/manticore_transport.rb
|
122
|
+
- lib/logstash/plugin_mixins/enterprise_search/ssl_configs.rb
|
128
123
|
- logstash-integration-elastic_enterprise_search.gemspec
|
124
|
+
- spec/fixtures/certificates/generate.sh
|
125
|
+
- spec/fixtures/certificates/root_ca.crt
|
126
|
+
- spec/fixtures/certificates/root_ca.key
|
127
|
+
- spec/fixtures/certificates/root_keystore.jks
|
128
|
+
- spec/fixtures/certificates/root_untrusted_ca.crt
|
129
|
+
- spec/fixtures/certificates/root_untrusted_keystore.jks
|
130
|
+
- spec/fixtures/certificates/root_untrusted_keystore.p12
|
129
131
|
- spec/integration/outputs/elastic_app_search_spec.rb
|
130
132
|
- spec/integration/outputs/elastic_workplace_search_spec.rb
|
131
|
-
- spec/unit/outputs/
|
133
|
+
- spec/unit/outputs/client_spec.rb
|
134
|
+
- spec/unit/outputs/elastic_app_search_spec.rb
|
135
|
+
- spec/unit/outputs/elastic_workplace_search_spec.rb
|
136
|
+
- spec/unit/outputs/manticore_transport_spec.rb
|
132
137
|
homepage: http://www.elastic.co/guide/en/logstash/current/index.html
|
133
138
|
licenses:
|
134
139
|
- Apache-2.0
|
@@ -152,11 +157,21 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
157
|
- !ruby/object:Gem::Version
|
153
158
|
version: '0'
|
154
159
|
requirements: []
|
155
|
-
rubygems_version: 3.
|
160
|
+
rubygems_version: 3.2.33
|
156
161
|
signing_key:
|
157
162
|
specification_version: 4
|
158
163
|
summary: Integration with Elastic Enterprise Search - output plugins
|
159
164
|
test_files:
|
165
|
+
- spec/fixtures/certificates/generate.sh
|
166
|
+
- spec/fixtures/certificates/root_ca.crt
|
167
|
+
- spec/fixtures/certificates/root_ca.key
|
168
|
+
- spec/fixtures/certificates/root_keystore.jks
|
169
|
+
- spec/fixtures/certificates/root_untrusted_ca.crt
|
170
|
+
- spec/fixtures/certificates/root_untrusted_keystore.jks
|
171
|
+
- spec/fixtures/certificates/root_untrusted_keystore.p12
|
160
172
|
- spec/integration/outputs/elastic_app_search_spec.rb
|
161
173
|
- spec/integration/outputs/elastic_workplace_search_spec.rb
|
162
|
-
- spec/unit/outputs/
|
174
|
+
- spec/unit/outputs/client_spec.rb
|
175
|
+
- spec/unit/outputs/elastic_app_search_spec.rb
|
176
|
+
- spec/unit/outputs/elastic_workplace_search_spec.rb
|
177
|
+
- spec/unit/outputs/manticore_transport_spec.rb
|
@@ -1,64 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require "logstash/devutils/rspec/spec_helper"
|
3
|
-
require "logstash/outputs/elastic_app_search"
|
4
|
-
require "logstash/codecs/plain"
|
5
|
-
require "logstash/event"
|
6
|
-
require "elastic-app-search"
|
7
|
-
|
8
|
-
describe LogStash::Outputs::ElasticAppSearch do
|
9
|
-
let(:sample_event) { LogStash::Event.new }
|
10
|
-
let(:host) { "test-host" }
|
11
|
-
let(:api_key) { "my_key" }
|
12
|
-
let(:engine) { "test-engine" }
|
13
|
-
subject { described_class.new(config) }
|
14
|
-
|
15
|
-
describe "#register" do
|
16
|
-
before(:each) do
|
17
|
-
allow(subject).to receive(:check_connection!)
|
18
|
-
end
|
19
|
-
context "when host is configured" do
|
20
|
-
let(:config) { { "host" => host, "api_key" => api_key, "engine" => engine } }
|
21
|
-
it "does not raise an error" do
|
22
|
-
expect { subject.register }.to_not raise_error
|
23
|
-
end
|
24
|
-
it "configures the Swiftype client" do
|
25
|
-
subject.register
|
26
|
-
client = subject.instance_variable_get(:@client)
|
27
|
-
expect(client.class).to eq(Elastic::AppSearch::Client)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
context "when path is configured" do
|
31
|
-
let(:config) { { "api_key" => api_key, "engine" => engine, "path" => "/v1", "url" => "http://localhost:9300" } }
|
32
|
-
it "configures the Swiftype client" do
|
33
|
-
subject.register
|
34
|
-
client = subject.instance_variable_get(:@client)
|
35
|
-
expect(client.class).to eq(Elastic::AppSearch::Client)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
context "when host and path is configured" do
|
39
|
-
let(:config) { { "host" => host, "api_key" => api_key, "engine" => engine, "path" => "/v1" } }
|
40
|
-
it "raises an error" do
|
41
|
-
expect { subject.register }.to raise_error(LogStash::ConfigurationError)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
context "when host and url is configured" do
|
45
|
-
let(:config) { { "host" => host, "api_key" => api_key, "engine" => engine, "url" => "http://localhost:9300" } }
|
46
|
-
it "raises an error" do
|
47
|
-
expect { subject.register }.to raise_error(LogStash::ConfigurationError)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
context "when neither host nor url is configured" do
|
51
|
-
let(:config) { { "api_key" => api_key, "engine" => engine } }
|
52
|
-
it "raises an error" do
|
53
|
-
expect { subject.register }.to raise_error(LogStash::ConfigurationError)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
context "when engine is in sprintf format" do
|
57
|
-
let(:config) { { "host" => host, "api_key" => api_key, "engine" => "%{type}" } }
|
58
|
-
it "connection is not checked" do
|
59
|
-
expect { subject.register }.to_not raise_error
|
60
|
-
expect(subject).not_to receive(:check_connection!)
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|