fluent-plugin-elasticsearch 3.0.1 → 3.0.2

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: 922b71db0e33341c9be81d522da1fe51db43346195104d3c5cb9eedc8146ade8
4
- data.tar.gz: 855510d16b2e6999a8d8884c9f4c64c41974fef91d0c2e57410d393335d50396
3
+ metadata.gz: 73279ef661fbc0c7d8f5539b8e8524e7fce1ade17ae44e2f0ca96bd49fd047d8
4
+ data.tar.gz: b9b5fd6396f87231a9b430fa194da647f221083ec292cd5fa3092a5f76f57655
5
5
  SHA512:
6
- metadata.gz: fd43e39d0e436923a5146b0841546f59b0e36c9a6a9f06a41e9ac80d71faf24fbebc87f88721c1da199d38869c42fcc0b8862aa852688d945015fd550bb9244b
7
- data.tar.gz: 3fcad730cb9ecbe8713f9361e50b42ca985834cc60e62d42a4c551f69c02ef5131bd073d9940814bff266c83470cbee9dfcbb528a99f585cddea86c391886609
6
+ metadata.gz: 7893520f2758d4c256c33c4656db6b5afb4125ff55bb18277f5edb7cee8a9cd14b7e9705f005a5c4ce6574b51548bee239cd261036f2aa3cb1f0eff24104cb65
7
+ data.tar.gz: 281ea7247a4d3b6ccf35a47698f632bc91fcac7f51a5b16fdb3b4a3e75a96bd518807de1c018b905e0d6cf353fe56973a06d04483f39c2decf80c67ac320429d
@@ -4,11 +4,15 @@ rvm:
4
4
  - 2.1
5
5
  - 2.2
6
6
  - 2.3
7
- - 2.4.4
8
- - 2.5.1
7
+ - 2.4.5
8
+ - 2.5.3
9
+ - 2.6.0
9
10
 
10
11
  gemfile:
11
12
  - Gemfile
12
13
 
14
+ before_install:
15
+ - gem update --system=2.7.8
16
+
13
17
  script: bundle exec rake test
14
18
  sudo: false
data/History.md CHANGED
@@ -1,6 +1,12 @@
1
1
  ## Changelog [[tags]](https://github.com/uken/fluent-plugin-elasticsearch/tags)
2
2
 
3
3
  ### [Unreleased]
4
+
5
+ ### 3.0.2
6
+ - appveyor: Remove Ruby 2.1 CI targets on AppVeyor (#524)
7
+ - Follow removal of _routing field change on recent Elasticsearch (#523)
8
+ - Travis: Tweak to use Ruby versions (#522)
9
+
4
10
  ### 3.0.1
5
11
  - Remove needless Elasticsearch version detection (#520)
6
12
 
@@ -25,11 +25,6 @@ environment:
25
25
  devkit: C:\Ruby23-x64\DevKit
26
26
  - ruby_version: "22-x64"
27
27
  devkit: C:\Ruby23-x64\DevKit
28
- - ruby_version: "21-x64"
29
- devkit: C:\Ruby23-x64\DevKit
30
- - ruby_version: "21"
31
- devkit: C:\Ruby23\DevKit
32
- WIN_RAPID: true
33
28
  matrix:
34
29
  allow_failures:
35
30
  - ruby_version: "21"
@@ -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 = '3.0.1'
6
+ s.version = '3.0.2'
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}
@@ -268,6 +268,8 @@ EOC
268
268
  if @buffer_config.flush_thread_count < 2
269
269
  log.warn "To prevent events traffic jam, you should specify 2 or more 'flush_thread_count'."
270
270
  end
271
+
272
+ @routing_key_name = configure_routing_key_name
271
273
  end
272
274
 
273
275
  def backend_options
@@ -291,6 +293,14 @@ EOC
291
293
  Elasticsearch::VERSION
292
294
  end
293
295
 
296
+ def configure_routing_key_name
297
+ if @last_seen_major_version >= 7
298
+ 'routing'
299
+ else
300
+ '_routing'
301
+ end
302
+ end
303
+
294
304
  def convert_compat_id_key(key)
295
305
  if key.include?('.') && !key.start_with?('$[')
296
306
  key = "$.#{key}" unless key.start_with?('$.')
@@ -302,7 +312,7 @@ EOC
302
312
  result = []
303
313
  result << [record_accessor_create(@id_key), '_id'] if @id_key
304
314
  result << [record_accessor_create(@parent_key), '_parent'] if @parent_key
305
- result << [record_accessor_create(@routing_key), '_routing'] if @routing_key
315
+ result << [record_accessor_create(@routing_key), @routing_key_name] if @routing_key
306
316
  result
307
317
  end
308
318
 
@@ -32,7 +32,7 @@ module Fluent::Plugin
32
32
  end
33
33
 
34
34
  def create_meta_config_map
35
- {'id_key' => '_id', 'parent_key' => '_parent', 'routing_key' => '_routing'}
35
+ {'id_key' => '_id', 'parent_key' => '_parent', 'routing_key' => @routing_key_name}
36
36
  end
37
37
 
38
38
 
@@ -1764,13 +1764,24 @@ class ElasticsearchOutput < Test::Unit::TestCase
1764
1764
  assert(!index_cmds[0]['index'].has_key?('_parent'))
1765
1765
  end
1766
1766
 
1767
- def test_adds_routing_key_when_configured
1768
- driver.configure("routing_key routing_id\n")
1769
- stub_elastic
1770
- driver.run(default_tag: 'test') do
1771
- driver.feed(sample_record)
1767
+ class AddsRoutingKeyWhenConfiguredTest < self
1768
+ def test_es6
1769
+ driver('', 6).configure("routing_key routing_id\n")
1770
+ stub_elastic
1771
+ driver.run(default_tag: 'test') do
1772
+ driver.feed(sample_record)
1773
+ end
1774
+ assert_equal(index_cmds[0]['index']['_routing'], 'routing')
1775
+ end
1776
+
1777
+ def test_es7
1778
+ driver('', 7).configure("routing_key routing_id\n")
1779
+ stub_elastic
1780
+ driver.run(default_tag: 'test') do
1781
+ driver.feed(sample_record)
1782
+ end
1783
+ assert_equal(index_cmds[0]['index']['routing'], 'routing')
1772
1784
  end
1773
- assert_equal(index_cmds[0]['index']['_routing'], 'routing')
1774
1785
  end
1775
1786
 
1776
1787
  class NestedRoutingKeyTest < self
@@ -735,13 +735,24 @@ class ElasticsearchOutputDynamic < Test::Unit::TestCase
735
735
  assert(!index_cmds[0]['index'].has_key?('_parent'))
736
736
  end
737
737
 
738
- def test_adds_routing_key_when_configured
739
- driver.configure("routing_key routing_id\n")
740
- stub_elastic
741
- driver.run(default_tag: 'test') do
742
- driver.feed(sample_record)
738
+ class AddsRoutingKeyWhenConfiguredTest < self
739
+ def test_es6
740
+ driver('', 6).configure("routing_key routing_id\n")
741
+ stub_elastic
742
+ driver.run(default_tag: 'test') do
743
+ driver.feed(sample_record)
744
+ end
745
+ assert_equal(index_cmds[0]['index']['_routing'], 'routing')
746
+ end
747
+
748
+ def test_es7
749
+ driver('', 7).configure("routing_key routing_id\n")
750
+ stub_elastic
751
+ driver.run(default_tag: 'test') do
752
+ driver.feed(sample_record)
753
+ end
754
+ assert_equal(index_cmds[0]['index']['routing'], 'routing')
743
755
  end
744
- assert_equal(index_cmds[0]['index']['_routing'], 'routing')
745
756
  end
746
757
 
747
758
  class NestedRoutingKeyTest < self
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: 3.0.1
4
+ version: 3.0.2
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-26 00:00:00.000000000 Z
12
+ date: 2019-01-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd