fluent-plugin-elasticsearch 4.1.2 → 4.1.3

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: 367f610faf1266994e676a07ca2fc391bf0951036f356fd4a95a6a7d7cce1b61
4
- data.tar.gz: 56fc5e47f6dd8e63df03f6190fc0f3dfff2e1fae548b38cc9cdb328f75246ade
3
+ metadata.gz: 6b4183d1e2afbcf9e0e5f78b6cb6ed2fff3206f495a8676d38eb1dbc1ff7267f
4
+ data.tar.gz: 2f1644d04286ae42c51e869c6aadd928ec00b678a405dce838cb1d1802ebf5b1
5
5
  SHA512:
6
- metadata.gz: 812b336dcf870a4dbb2ecfbc87304b8c6b6cfafb561d2cf6eece11f35e29e9aa484ab8365fa9245a578c51ec540fcaf09925dc68668820ce3ab7c71041720dd2
7
- data.tar.gz: da2c1b8bbbdd364ff5a3df1214a54151a7e9e809230b12e75e06b42a0eb7df790124898cd6c137c82edede8c94f5e8adc9d7eea05134bff0a084d1de11b5269e
6
+ metadata.gz: bc88d00e8800e7062dff4fdb9b6bc67c509ee851f5e726321783bec8902df6b548a2533d7c278151882b6f534e5adc680ba83964885d7bb9fd520340484c8478
7
+ data.tar.gz: 07f4379b3bfee4b22bb50f60c441fa60c87ee65967fa70523c3a6fdc7d0cc80c0fced8fd92958227eb64e353c8e623293f5c1e3d17fba848cdab707969d4f3d4
data/History.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ### [Unreleased]
4
4
 
5
+ ### 4.1.3
6
+ - Load multiple templates even if template_name and template_file given (#799)
7
+ - Handle elasticsearch-ruby 7.9.0 using HTTP method changes (#795)
8
+
5
9
  ### 4.1.2
6
10
  - Use Hash#dig instead of Hash#[] on retrieving version information from Elasticsearch info API (#793)
7
11
 
data/README.md CHANGED
@@ -431,7 +431,7 @@ Specify index templates in form of hash. Can contain multiple templates.
431
431
  templates { "template_name_1": "path_to_template_1_file", "template_name_2": "path_to_template_2_file"}
432
432
  ```
433
433
 
434
- If `template_file` and `template_name` are set, then this parameter will be ignored.
434
+ **Note:** Before ES plugin v4.1.2, if `template_file` and `template_name` are set, then this parameter will be ignored. In 4.1.3 or later, `template_file` and `template_name` can work with `templates`.
435
435
 
436
436
  ### customize_template
437
437
 
@@ -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 = '4.1.2'
6
+ s.version = '4.1.3'
7
7
  s.authors = ['diogo', 'pitr', 'Hiroshi Hatake']
8
8
  s.email = ['pitr.vern@gmail.com', 'me@diogoterror.com', 'cosmo0920.wp@gmail.com']
9
9
  s.description = %q{Elasticsearch output plugin for Fluent event collector}
@@ -247,7 +247,8 @@ EOC
247
247
  template_installation_actual(@deflector_alias ? @deflector_alias : @index_name, @template_name, @customize_template, @application_name, @index_name, @ilm_policy_id)
248
248
  end
249
249
  verify_ilm_working if @enable_ilm
250
- elsif @templates
250
+ end
251
+ if @templates
251
252
  retry_operate(@max_retry_putting_template, @fail_on_putting_template_retry_exceed) do
252
253
  templates_hash_install(@templates, @template_overwrite)
253
254
  end
@@ -20,6 +20,11 @@ class ElasticsearchInputTest < Test::Unit::TestCase
20
20
  @driver = nil
21
21
  log = Fluent::Engine.log
22
22
  log.out.logs.slice!(0, log.out.logs.length)
23
+ @http_method = if Gem::Version.new(Elasticsearch::VERSION) >= Gem::Version.new("7.9.0")
24
+ :post
25
+ else
26
+ :get
27
+ end
23
28
  end
24
29
 
25
30
  def driver(conf='')
@@ -313,7 +318,7 @@ class ElasticsearchInputTest < Test::Unit::TestCase
313
318
  end
314
319
 
315
320
  def test_emit
316
- stub_request(:get, "http://localhost:9200/fluentd/_search?scroll=1m&size=1000").
321
+ stub_request(@http_method, "http://localhost:9200/fluentd/_search?scroll=1m&size=1000").
317
322
  with(body: "{\"sort\":[\"_doc\"]}").
318
323
  to_return(status: 200, body: sample_response.to_s,
319
324
  headers: {'Content-Type' => 'application/json'})
@@ -328,7 +333,7 @@ class ElasticsearchInputTest < Test::Unit::TestCase
328
333
 
329
334
  def test_emit_with_custom_index_name
330
335
  index_name = "logstash"
331
- stub_request(:get, "http://localhost:9200/#{index_name}/_search?scroll=1m&size=1000").
336
+ stub_request(@http_method, "http://localhost:9200/#{index_name}/_search?scroll=1m&size=1000").
332
337
  with(body: "{\"sort\":[\"_doc\"]}").
333
338
  to_return(status: 200, body: sample_response(index_name).to_s,
334
339
  headers: {'Content-Type' => 'application/json'})
@@ -343,7 +348,7 @@ class ElasticsearchInputTest < Test::Unit::TestCase
343
348
 
344
349
  def test_emit_with_parse_timestamp
345
350
  index_name = "fluentd"
346
- stub_request(:get, "http://localhost:9200/#{index_name}/_search?scroll=1m&size=1000").
351
+ stub_request(@http_method, "http://localhost:9200/#{index_name}/_search?scroll=1m&size=1000").
347
352
  with(body: "{\"sort\":[\"_doc\"]}").
348
353
  to_return(status: 200, body: sample_response(index_name).to_s,
349
354
  headers: {'Content-Type' => 'application/json'})
@@ -361,7 +366,7 @@ class ElasticsearchInputTest < Test::Unit::TestCase
361
366
 
362
367
  def test_emit_with_parse_timestamp_and_timstamp_format
363
368
  index_name = "fluentd"
364
- stub_request(:get, "http://localhost:9200/#{index_name}/_search?scroll=1m&size=1000").
369
+ stub_request(@http_method, "http://localhost:9200/#{index_name}/_search?scroll=1m&size=1000").
365
370
  with(body: "{\"sort\":[\"_doc\"]}").
366
371
  to_return(status: 200, body: sample_response(index_name).to_s,
367
372
  headers: {'Content-Type' => 'application/json'})
@@ -380,7 +385,7 @@ class ElasticsearchInputTest < Test::Unit::TestCase
380
385
  end
381
386
 
382
387
  def test_emit_with_docinfo
383
- stub_request(:get, "http://localhost:9200/fluentd/_search?scroll=1m&size=1000").
388
+ stub_request(@http_method, "http://localhost:9200/fluentd/_search?scroll=1m&size=1000").
384
389
  with(body: "{\"sort\":[\"_doc\"]}").
385
390
  to_return(status: 200, body: sample_response.to_s,
386
391
  headers: {'Content-Type' => 'application/json'})
@@ -399,11 +404,11 @@ class ElasticsearchInputTest < Test::Unit::TestCase
399
404
  end
400
405
 
401
406
  def test_emit_with_slices
402
- stub_request(:get, "http://localhost:9200/fluentd/_search?scroll=1m&size=1000").
407
+ stub_request(@http_method, "http://localhost:9200/fluentd/_search?scroll=1m&size=1000").
403
408
  with(body: "{\"sort\":[\"_doc\"],\"slice\":{\"id\":0,\"max\":2}}").
404
409
  to_return(status: 200, body: sample_response.to_s,
405
410
  headers: {'Content-Type' => 'application/json'})
406
- stub_request(:get, "http://localhost:9200/fluentd/_search?scroll=1m&size=1000").
411
+ stub_request(@http_method, "http://localhost:9200/fluentd/_search?scroll=1m&size=1000").
407
412
  with(body: "{\"sort\":[\"_doc\"],\"slice\":{\"id\":1,\"max\":2}}").
408
413
  to_return(status: 200, body: sample_response.to_s,
409
414
  headers: {'Content-Type' => 'application/json'})
@@ -419,12 +424,12 @@ class ElasticsearchInputTest < Test::Unit::TestCase
419
424
  end
420
425
 
421
426
  def test_emit_with_size
422
- stub_request(:get, "http://localhost:9200/fluentd/_search?scroll=1m&size=1").
427
+ stub_request(@http_method, "http://localhost:9200/fluentd/_search?scroll=1m&size=1").
423
428
  with(body: "{\"sort\":[\"_doc\"]}").
424
429
  to_return(status: 200, body: sample_scroll_response.to_s,
425
430
  headers: {'Content-Type' => 'application/json'})
426
431
  connection = 0
427
- scroll_request = stub_request(:get, "http://localhost:9200/_search/scroll?scroll=1m").
432
+ scroll_request = stub_request(@http_method, "http://localhost:9200/_search/scroll?scroll=1m").
428
433
  with(
429
434
  body: "{\"scroll_id\":\"WomkoUKG0QPB679Ulo6TqQgh3pIGRUmrl9qXXGK3EeiQh9rbYNasTkspZQcJ01uz\"}") do
430
435
  connection += 1
@@ -2659,7 +2659,7 @@ class ElasticsearchOutputTest < Test::Unit::TestCase
2659
2659
  assert_requested(:put, "https://logs.google.com:777/es//_template/logstash3", times: 1)
2660
2660
  end
2661
2661
 
2662
- def test_templates_not_used
2662
+ def test_templates_are_also_used
2663
2663
  cwd = File.dirname(__FILE__)
2664
2664
  template_file = File.join(cwd, 'test_template.json')
2665
2665
 
@@ -2703,8 +2703,8 @@ class ElasticsearchOutputTest < Test::Unit::TestCase
2703
2703
 
2704
2704
  assert_requested(:put, "https://logs.google.com:777/es//_template/logstash", times: 1)
2705
2705
 
2706
- assert_not_requested(:put, "https://logs.google.com:777/es//_template/logstash1")
2707
- assert_not_requested(:put, "https://logs.google.com:777/es//_template/logstash2")
2706
+ assert_requested(:put, "https://logs.google.com:777/es//_template/logstash1")
2707
+ assert_requested(:put, "https://logs.google.com:777/es//_template/logstash2")
2708
2708
  end
2709
2709
 
2710
2710
  def test_templates_can_be_partially_created_if_error_occurs
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: 4.1.2
4
+ version: 4.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - diogo
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-08-19 00:00:00.000000000 Z
13
+ date: 2020-09-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: fluentd