fluent-plugin-elasticsearch 2.11.3 → 2.11.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff924cb0d3a10af63436dc4ccf10256530637857bc3cc64dcef2cb59473a15a9
4
- data.tar.gz: 7f6615d23e6ead3b22abe866036f79f93f1acfb77a87a1251b1ccd6511df01e1
3
+ metadata.gz: ee8aaeedb5eda1f4857a091853a1c479e7d455d0e44db13eea8591aa93424ee0
4
+ data.tar.gz: 96dd085e19d9ee4e22d5f3844a366c7fe1e737a5426240259911295758d735ad
5
5
  SHA512:
6
- metadata.gz: 1004359a2090e989ebc1906cb198388178d0556859d07cd051fce90f248d2d2e02c247fdb5f29714aa77e29634e5649d4bac11861d01beb3da92574bd75fe9be
7
- data.tar.gz: 0067bfcfc7efc89a9d48c8c3d83c1e0ff2a430c413d61a7ff4dace664832d4f1a1443b90c0066113313e315b736183278bbb55f7955424dcc984de047e3ed331
6
+ metadata.gz: b460e08f99c4c663e432ffa8adafb065b005680d5a534b67ae9485ae01552bc14c0f6fe11b9c0afc714987871977c8e7a751ab980b54df63704d8238405d282f
7
+ data.tar.gz: e6a83a30052a48a8c6986fd47fec45b1e6c700d0b2a9a39d7d8379d897907df08a648ec348cc445d91f2e2ebd399506a3aad6a4553b91a45ff110b11f1680992
data/History.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ### [Unreleased]
4
4
 
5
+ ### 2.11.4
6
+ - Persistent backend (#456)
7
+
5
8
  ### 2.11.3
6
9
  - Implement the `include_index_in_url` option for out_elasticsearch (#451)
7
10
  - Add an option `include_index_in_url` to allow URL-based conrtrols (#450)
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.3'
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
- excon_options = { client_key: @client_key, client_cert: @client_cert, client_key_pass: @client_key_pass }
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
- excon_options = { client_key: @client_key, client_cert: @client_cert, client_key_pass: @client_key_pass }
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.3
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-07-27 00:00:00.000000000 Z
12
+ date: 2018-08-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd