fluent-plugin-elasticsearch 3.0.1 → 3.0.2
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/.travis.yml +6 -2
- data/History.md +6 -0
- data/appveyor.yml +0 -5
- data/fluent-plugin-elasticsearch.gemspec +1 -1
- data/lib/fluent/plugin/out_elasticsearch.rb +11 -1
- data/lib/fluent/plugin/out_elasticsearch_dynamic.rb +1 -1
- data/test/plugin/test_out_elasticsearch.rb +17 -6
- data/test/plugin/test_out_elasticsearch_dynamic.rb +17 -6
- 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: 73279ef661fbc0c7d8f5539b8e8524e7fce1ade17ae44e2f0ca96bd49fd047d8
|
4
|
+
data.tar.gz: b9b5fd6396f87231a9b430fa194da647f221083ec292cd5fa3092a5f76f57655
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7893520f2758d4c256c33c4656db6b5afb4125ff55bb18277f5edb7cee8a9cd14b7e9705f005a5c4ce6574b51548bee239cd261036f2aa3cb1f0eff24104cb65
|
7
|
+
data.tar.gz: 281ea7247a4d3b6ccf35a47698f632bc91fcac7f51a5b16fdb3b4a3e75a96bd518807de1c018b905e0d6cf353fe56973a06d04483f39c2decf80c67ac320429d
|
data/.travis.yml
CHANGED
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
|
|
data/appveyor.yml
CHANGED
@@ -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.
|
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),
|
315
|
+
result << [record_accessor_create(@routing_key), @routing_key_name] if @routing_key
|
306
316
|
result
|
307
317
|
end
|
308
318
|
|
@@ -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
|
-
|
1768
|
-
|
1769
|
-
|
1770
|
-
|
1771
|
-
driver.
|
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
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
driver.
|
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.
|
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:
|
12
|
+
date: 2019-01-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|