fluent-plugin-elasticsearch 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +3 -0
- data/fluent-plugin-elasticsearch.gemspec +1 -1
- data/lib/fluent/plugin/out_elasticsearch.rb +4 -3
- data/test/plugin/test_out_elasticsearch.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c29f67bc984aa2da3c26d64f4eb8b39a696ec45a
|
4
|
+
data.tar.gz: 5c3b38d9a83cce6c3b6dd0c6cfec3cb258b93801
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab8603053553d60e49b37eefea82d5dab6d6ef051225e4765907de6139d749231b2d7dec145c06d1d72396deadb0c02cccb441f73061e98c20fbe8799a1ee69d
|
7
|
+
data.tar.gz: 3c59c0982680b9cb23a50abd6e5d89d5251809047c39ff54371285b93400446a082048ed285c8e56738dca76245b1ef46f50ab395cf07f26dca1e74d6097aeed
|
data/History.md
CHANGED
@@ -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.
|
6
|
+
s.version = '2.4.0'
|
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}
|
@@ -320,7 +320,8 @@ module Fluent::Plugin
|
|
320
320
|
def expand_placeholders(metadata)
|
321
321
|
logstash_prefix = extract_placeholders(@logstash_prefix, metadata)
|
322
322
|
index_name = extract_placeholders(@index_name, metadata)
|
323
|
-
|
323
|
+
type_name = extract_placeholders(@type_name, metadata)
|
324
|
+
return logstash_prefix, index_name, type_name
|
324
325
|
end
|
325
326
|
|
326
327
|
def multi_workers_ready?
|
@@ -333,7 +334,7 @@ module Fluent::Plugin
|
|
333
334
|
meta = {}
|
334
335
|
|
335
336
|
tag = chunk.metadata.tag
|
336
|
-
logstash_prefix, index_name = expand_placeholders(chunk.metadata)
|
337
|
+
logstash_prefix, index_name, type_name = expand_placeholders(chunk.metadata)
|
337
338
|
@error = Fluent::Plugin::ElasticsearchErrorHandler.new(self)
|
338
339
|
|
339
340
|
chunk.msgpack_each do |time, record|
|
@@ -384,7 +385,7 @@ module Fluent::Plugin
|
|
384
385
|
if target_type_parent && target_type_parent[target_type_child_key]
|
385
386
|
target_type = target_type_parent.delete(target_type_child_key)
|
386
387
|
else
|
387
|
-
target_type =
|
388
|
+
target_type = type_name
|
388
389
|
end
|
389
390
|
|
390
391
|
meta.clear
|
@@ -821,6 +821,16 @@ class ElasticsearchOutput < Test::Unit::TestCase
|
|
821
821
|
assert_equal('mytype', index_cmds.first['index']['_type'])
|
822
822
|
end
|
823
823
|
|
824
|
+
def test_writes_to_speficied_type_with_placeholders
|
825
|
+
driver.configure("type_name mytype.${tag}\n")
|
826
|
+
stub_elastic_ping
|
827
|
+
stub_elastic
|
828
|
+
driver.run(default_tag: 'test') do
|
829
|
+
driver.feed(sample_record)
|
830
|
+
end
|
831
|
+
assert_equal('mytype.test', index_cmds.first['index']['_type'])
|
832
|
+
end
|
833
|
+
|
824
834
|
def test_writes_to_target_type_key
|
825
835
|
driver.configure("target_type_key @target_type\n")
|
826
836
|
stub_elastic_ping
|
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.
|
4
|
+
version: 2.4.0
|
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: 2017-11-
|
12
|
+
date: 2017-11-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|