logstash-output-solr-lw 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash/outputs/solr.rb +2 -3
- data/logstash-output-solr-lw.gemspec +1 -1
- data/spec/outputs/solr_spec.rb +20 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6612277d396cb3be159156516ccbce2f60fd7cbc6cf9ef69f17798102496955
|
4
|
+
data.tar.gz: e01c6fda0ecc0381d73e2a0643792f484ec50afc2acb52e13ca671a8957415c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 122b55bf955b5fc150726addbedcfffbf57f7558c08bbef679a60e7a178067573a3e2971db462b7f83489232c3bd8362f168acf692e24bff9c20fbc32ee27b89
|
7
|
+
data.tar.gz: 4c495993c13e99f152399426b83f5a46f10f711552162396868a4a3fb5b90dac1ee2cafe45a80fc93310dfd8a7c0cfe3e3a1c7caa7392a1fdcf8015a32ab2228
|
@@ -68,14 +68,13 @@ class LogStash::Outputs::Solr < LogStash::Outputs::Base
|
|
68
68
|
@zk = nil
|
69
69
|
|
70
70
|
if @mode == MODE_STANDALONE then
|
71
|
-
u = @url
|
72
71
|
if !@user.nil? and !@user.to_s.strip.empty? and !@password.nil? and !@password.to_s.strip.empty? then
|
73
72
|
uri = URI.parse(@url)
|
74
73
|
uri.user = @user
|
75
74
|
uri.password = @password
|
76
|
-
|
75
|
+
@url = uri.to_s()
|
77
76
|
end
|
78
|
-
@solr_std[@collection] = RSolr.connect :url =>
|
77
|
+
@solr_std[@collection] = RSolr.connect :url => @url
|
79
78
|
elsif @mode == MODE_SOLRCLOUD then
|
80
79
|
@zk = ZK.new(@zk_host)
|
81
80
|
cloud_connection = RSolr::Cloud::Connection.new(@zk, :user => @user, :password => @password)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-solr-lw'
|
3
|
-
s.version = "0.
|
3
|
+
s.version = "0.6.0"
|
4
4
|
s.licenses = ["Apache License (2.0)"]
|
5
5
|
s.summary = "Logstash output plugin for sending data to Solr."
|
6
6
|
s.description = "Logstash output plugin for sending data to Solr. It supports SolrCloud, not only Standalone Solr."
|
data/spec/outputs/solr_spec.rb
CHANGED
@@ -73,6 +73,26 @@ describe LogStash::Outputs::Solr do
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
describe 'register_standalone_basic_auth' do
|
77
|
+
let(:config) {
|
78
|
+
{
|
79
|
+
'url' => 'http://localhost:8983/solr/collection1',
|
80
|
+
'user' => 'user1',
|
81
|
+
'password' => 'pass1'
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
it 'mode' do
|
86
|
+
output = LogStash::Outputs::Solr.new(config)
|
87
|
+
output.register
|
88
|
+
|
89
|
+
mode = output.instance_variable_get('@mode')
|
90
|
+
expect(mode).to eq('Standalone')
|
91
|
+
url = output.instance_variable_get('@url')
|
92
|
+
expect(url).to eq('http://user1:pass1@localhost:8983/solr/collection1')
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
76
96
|
describe 'register_solrcloud' do
|
77
97
|
before do
|
78
98
|
start_zookeeper
|