fluent-plugin-elasticsearch 2.11.3 → 2.11.4
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/History.md +3 -0
- data/README.md +12 -0
- data/fluent-plugin-elasticsearch.gemspec +1 -1
- data/lib/fluent/plugin/out_elasticsearch.rb +15 -2
- data/lib/fluent/plugin/out_elasticsearch_dynamic.rb +1 -2
- data/test/plugin/test_out_elasticsearch.rb +1 -0
- data/test/plugin/test_out_elasticsearch_dynamic.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee8aaeedb5eda1f4857a091853a1c479e7d455d0e44db13eea8591aa93424ee0
|
4
|
+
data.tar.gz: 96dd085e19d9ee4e22d5f3844a366c7fe1e737a5426240259911295758d735ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b460e08f99c4c663e432ffa8adafb065b005680d5a534b67ae9485ae01552bc14c0f6fe11b9c0afc714987871977c8e7a751ab980b54df63704d8238405d282f
|
7
|
+
data.tar.gz: e6a83a30052a48a8c6986fd47fec45b1e6c700d0b2a9a39d7d8379d897907df08a648ec348cc445d91f2e2ebd399506a3aad6a4553b91a45ff110b11f1680992
|
data/History.md
CHANGED
data/README.md
CHANGED
@@ -56,6 +56,7 @@ Current maintainers: @cosmo0920
|
|
56
56
|
+ [with_transporter_log](#with_transporter_log)
|
57
57
|
+ [content_type](#content_type)
|
58
58
|
+ [include_index_in_url](#include_index_in_url)
|
59
|
+
+ [http_backend](#http_backend)
|
59
60
|
+ [Client/host certificate options](#clienthost-certificate-options)
|
60
61
|
+ [Proxy Support](#proxy-support)
|
61
62
|
+ [Buffer options](#buffer-options)
|
@@ -624,6 +625,17 @@ You can use this option to enforce an URL-based access control.
|
|
624
625
|
include_index_in_url true
|
625
626
|
```
|
626
627
|
|
628
|
+
### http_backend
|
629
|
+
|
630
|
+
With `http_backend typhoeus`, elasticsearch plugin uses typhoeus faraday http backend.
|
631
|
+
Typhoeus can handle HTTP keepalive.
|
632
|
+
|
633
|
+
Default value is `excon` which is default http_backend of elasticsearch plugin.
|
634
|
+
|
635
|
+
```
|
636
|
+
http_backend typhoeus
|
637
|
+
```
|
638
|
+
|
627
639
|
### Client/host certificate options
|
628
640
|
|
629
641
|
Need to verify Elasticsearch's certificate? You can use the following parameter to specify a CA instead of using an environment variable.
|
@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'fluent-plugin-elasticsearch'
|
6
|
-
s.version = '2.11.
|
6
|
+
s.version = '2.11.4'
|
7
7
|
s.authors = ['diogo', 'pitr']
|
8
8
|
s.email = ['pitr.vern@gmail.com', 'me@diogoterror.com']
|
9
9
|
s.description = %q{Elasticsearch output plugin for Fluent event collector}
|
@@ -107,6 +107,7 @@ elasticsearch gem v6.0.2 starts to use correct Content-Type. Please upgrade elas
|
|
107
107
|
see: https://github.com/elastic/elasticsearch-ruby/pull/514
|
108
108
|
EOC
|
109
109
|
config_param :include_index_in_url, :bool, :default => false
|
110
|
+
config_param :http_backend, :enum, list: [:excon, :typhoeus], :default => :excon
|
110
111
|
|
111
112
|
config_section :buffer do
|
112
113
|
config_set_default :@type, DEFAULT_BUFFER_TYPE
|
@@ -128,6 +129,7 @@ EOC
|
|
128
129
|
raise Fluent::ConfigError, "'tag' in chunk_keys is required." if not @chunk_key_tag
|
129
130
|
|
130
131
|
@time_parser = create_time_parser
|
132
|
+
@backend_options = backend_options
|
131
133
|
|
132
134
|
if @remove_keys
|
133
135
|
@remove_keys = @remove_keys.split(/\s*,\s*/)
|
@@ -207,6 +209,18 @@ EOC
|
|
207
209
|
end
|
208
210
|
end
|
209
211
|
|
212
|
+
def backend_options
|
213
|
+
case @http_backend
|
214
|
+
when :excon
|
215
|
+
{ client_key: @client_key, client_cert: @client_cert, client_key_pass: @client_key_pass }
|
216
|
+
when :typhoeus
|
217
|
+
require 'typhoeus'
|
218
|
+
{ sslkey: @client_key, sslcert: @client_cert, keypasswd: @client_key_pass }
|
219
|
+
end
|
220
|
+
rescue LoadError
|
221
|
+
raise Fluent::ConfigError, "You must install #{@http_backend} gem."
|
222
|
+
end
|
223
|
+
|
210
224
|
def detect_es_major_version
|
211
225
|
@_es_info ||= client.info
|
212
226
|
@_es_info["version"]["number"].to_i
|
@@ -257,8 +271,7 @@ EOC
|
|
257
271
|
|
258
272
|
def client
|
259
273
|
@_es ||= begin
|
260
|
-
|
261
|
-
adapter_conf = lambda {|f| f.adapter :excon, excon_options }
|
274
|
+
adapter_conf = lambda {|f| f.adapter @http_backend, @backend_options }
|
262
275
|
transport = Elasticsearch::Transport::Transport::HTTP::Faraday.new(get_connection_options.merge(
|
263
276
|
options: {
|
264
277
|
reload_connections: @reload_connections,
|
@@ -44,8 +44,7 @@ module Fluent::Plugin
|
|
44
44
|
|
45
45
|
@_es ||= begin
|
46
46
|
@current_config = connection_options[:hosts].clone
|
47
|
-
|
48
|
-
adapter_conf = lambda {|f| f.adapter :excon, excon_options }
|
47
|
+
adapter_conf = lambda {|f| f.adapter @http_backend, @backend_options }
|
49
48
|
transport = Elasticsearch::Transport::Transport::HTTP::Faraday.new(connection_options.merge(
|
50
49
|
options: {
|
51
50
|
reload_connections: @reload_connections,
|
@@ -207,6 +207,7 @@ class ElasticsearchOutput < Test::Unit::TestCase
|
|
207
207
|
assert_false instance.with_transporter_log
|
208
208
|
assert_equal :"application/json", instance.content_type
|
209
209
|
assert_equal "fluentd", default_type_name
|
210
|
+
assert_equal :excon, instance.http_backend
|
210
211
|
end
|
211
212
|
|
212
213
|
test 'configure Content-Type' do
|
@@ -98,6 +98,7 @@ class ElasticsearchOutputDynamic < Test::Unit::TestCase
|
|
98
98
|
assert_nil instance.client_key_pass
|
99
99
|
assert_false instance.with_transporter_log
|
100
100
|
assert_equal :"application/json", instance.content_type
|
101
|
+
assert_equal :excon, instance.http_backend
|
101
102
|
end
|
102
103
|
|
103
104
|
test 'configure Content-Type' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-elasticsearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.11.
|
4
|
+
version: 2.11.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- diogo
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-08-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|