logstash-output-elasticsearch 6.2.4-java → 6.2.5-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/logstash/outputs/elasticsearch/http_client/manticore_adapter.rb +4 -2
- data/logstash-output-elasticsearch.gemspec +1 -1
- data/spec/integration/outputs/index_spec.rb +9 -2
- data/spec/unit/outputs/elasticsearch/http_client/manticore_adapter_spec.rb +1 -0
- 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: b8d5f7fef1865846b84c49dfe25980784557041b
|
4
|
+
data.tar.gz: 9eb6fee0f2c819cd0a2f6abbb989d67d5d0f0724
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53269eaa667f3e7d4c3f3ee21c1f6f33771cb7a046e00a502b7d78d44614078bcde802d104a95ea4af26128383285c0bd74e998e06c2fb40b155c578c9fb835c
|
7
|
+
data.tar.gz: 2d70eaacefd1a827aa56feaccdd77c2c010512fd1b7a646bcad2078b2491f2958f262ea470a36d5370eecc34704f61718fcf8e6c76ccf76f7714e329c5aed331
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 6.2.5
|
2
|
+
- Send the Content-Type: application/json header that proper ES clients should send
|
3
|
+
|
1
4
|
## 6.2.4
|
2
5
|
- Fix bug where using escaped characters in the password field would attempt to show a warning but instead crash.
|
3
6
|
The warning was also not necessary since escaped characters never worked there before.
|
@@ -2,6 +2,8 @@ require 'manticore'
|
|
2
2
|
require 'cgi'
|
3
3
|
|
4
4
|
module LogStash; module Outputs; class ElasticSearch; class HttpClient;
|
5
|
+
DEFAULT_HEADERS = { "Content-Type" => "application/json" }
|
6
|
+
|
5
7
|
class ManticoreAdapter
|
6
8
|
attr_reader :manticore, :logger
|
7
9
|
|
@@ -15,7 +17,7 @@ module LogStash; module Outputs; class ElasticSearch; class HttpClient;
|
|
15
17
|
# We definitely don't need cookies
|
16
18
|
options[:cookies] = false
|
17
19
|
|
18
|
-
@
|
20
|
+
@client_params = {:headers => DEFAULT_HEADERS.merge(options[:headers] || {})}
|
19
21
|
|
20
22
|
if options[:proxy]
|
21
23
|
options[:proxy] = manticore_proxy_hash(options[:proxy])
|
@@ -45,7 +47,7 @@ module LogStash; module Outputs; class ElasticSearch; class HttpClient;
|
|
45
47
|
# @see Transport::Base#perform_request
|
46
48
|
#
|
47
49
|
def perform_request(url, method, path, params={}, body=nil)
|
48
|
-
params = (params || {}).merge
|
50
|
+
params = (params || {}).merge(@client_params)
|
49
51
|
params[:body] = body if body
|
50
52
|
|
51
53
|
if url.user
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-output-elasticsearch'
|
4
|
-
s.version = '6.2.
|
4
|
+
s.version = '6.2.5'
|
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"
|
@@ -44,7 +44,7 @@ describe "TARGET_BULK_BYTES", :integration => true do
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
describe "indexing" do
|
47
|
+
describe "indexing", :integration => true do
|
48
48
|
let(:event) { LogStash::Event.new("message" => "Hello World!", "type" => type) }
|
49
49
|
let(:index) { 10.times.collect { rand(10).to_s }.join("") }
|
50
50
|
let(:type) { 10.times.collect { rand(10).to_s }.join("") }
|
@@ -82,6 +82,13 @@ describe "indexing" do
|
|
82
82
|
expect(doc["_index"]).to eq(index)
|
83
83
|
end
|
84
84
|
end
|
85
|
+
|
86
|
+
it "sets the correct content-type header" do
|
87
|
+
expect(subject.client.pool.adapter.client).to receive(:send).
|
88
|
+
with(anything, anything, {:headers => {"Content-Type" => "application/json"}, :body => anything}).
|
89
|
+
and_call_original
|
90
|
+
subject.multi_receive(events)
|
91
|
+
end
|
85
92
|
end
|
86
93
|
|
87
94
|
describe "an indexer with custom index_type", :integration => true do
|
@@ -105,7 +112,7 @@ describe "indexing" do
|
|
105
112
|
it_behaves_like("an indexer")
|
106
113
|
end
|
107
114
|
|
108
|
-
describe "a secured indexer", :
|
115
|
+
describe "a secured indexer", :secure_integration => true do
|
109
116
|
let(:user) { "simpleuser" }
|
110
117
|
let(:password) { "abc123" }
|
111
118
|
let(:cacert) { "spec/fixtures/server.crt" }
|
@@ -28,6 +28,7 @@ describe LogStash::Outputs::ElasticSearch::HttpClient::ManticoreAdapter do
|
|
28
28
|
allow(resp).to receive(:code).and_return(200)
|
29
29
|
expect(subject.manticore).to receive(:get).
|
30
30
|
with(noauth_uri, {
|
31
|
+
:headers => {"Content-Type" => "application/json"},
|
31
32
|
:auth => {
|
32
33
|
:user => user,
|
33
34
|
:password => password,
|
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: 6.2.
|
4
|
+
version: 6.2.5
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|