fluent-plugin-elasticsearch 3.5.0 → 3.5.1
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/History.md +3 -0
- data/README.md +9 -0
- data/fluent-plugin-elasticsearch.gemspec +1 -1
- data/lib/fluent/plugin/out_elasticsearch.rb +24 -1
- data/test/plugin/test_out_elasticsearch.rb +21 -0
- 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: 157eb6e8f0c5412c1eec69c86be920e6737c2ed172cfd62618d284ae99bb68fc
|
4
|
+
data.tar.gz: 30d6c01d4626bbc016fe97e95caf529e1be40afa48196e806aebbc02457b7119
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b2830f040fda0e697a7b6e54eff371d78858637476eae95e8bbce7edc7334cb38b29977961b0ccf4f52aebb084638e4b4a8f3a8f5023766d28ec1781ab5b400
|
7
|
+
data.tar.gz: 8518ef11cdeca51a115e0be1201df72df0639c33e00f2b200148ede002e32d2a734cbba4e7b3accc16d25eed91120615277ba1ac40e39a901198f0d60425443a
|
data/History.md
CHANGED
data/README.md
CHANGED
@@ -85,6 +85,7 @@ Current maintainers: @cosmo0920
|
|
85
85
|
+ [suppress_doc_wrap](#suppress_doc_wrap)
|
86
86
|
+ [ignore_exceptions](#ignore_exceptions)
|
87
87
|
+ [exception_backup](#exception_backup)
|
88
|
+
+ [bulk_message_request_threshold](#bulk_message_request_threshold)
|
88
89
|
* [Troubleshooting](#troubleshooting)
|
89
90
|
+ [Cannot send events to elasticsearch](#cannot-send-events-to-elasticsearch)
|
90
91
|
+ [Cannot see detailed failure log](#cannot-see-detailed-failure-log)
|
@@ -1064,6 +1065,14 @@ Indicates whether to backup chunk when ignore exception occurs.
|
|
1064
1065
|
|
1065
1066
|
Default value is `true`.
|
1066
1067
|
|
1068
|
+
## bulk_message_request_threshold
|
1069
|
+
|
1070
|
+
Configure `bulk_message` request splitting threshold size.
|
1071
|
+
|
1072
|
+
Default value is `20MB`. (20 * 1024 * 1024)
|
1073
|
+
|
1074
|
+
If you specify this size as negative number, `bulk_message` request splitting feature will be disabled.
|
1075
|
+
|
1067
1076
|
## Troubleshooting
|
1068
1077
|
|
1069
1078
|
### Cannot send events to Elasticsearch
|
@@ -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.5.
|
6
|
+
s.version = '3.5.1'
|
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}
|
@@ -138,6 +138,7 @@ EOC
|
|
138
138
|
config_param :suppress_doc_wrap, :bool, :default => false
|
139
139
|
config_param :ignore_exceptions, :array, :default => [], value_type: :string, :desc => "Ignorable exception list"
|
140
140
|
config_param :exception_backup, :bool, :default => true, :desc => "Chunk backup flag when ignore exception occured"
|
141
|
+
config_param :bulk_message_request_threshold, :size, :default => TARGET_BULK_BYTES
|
141
142
|
|
142
143
|
config_section :buffer do
|
143
144
|
config_set_default :@type, DEFAULT_BUFFER_TYPE
|
@@ -296,6 +297,16 @@ EOC
|
|
296
297
|
Object.const_get(exception)
|
297
298
|
end
|
298
299
|
end.compact
|
300
|
+
|
301
|
+
if @bulk_message_request_threshold < 0
|
302
|
+
class << self
|
303
|
+
alias_method :split_request?, :split_request_size_uncheck?
|
304
|
+
end
|
305
|
+
else
|
306
|
+
class << self
|
307
|
+
alias_method :split_request?, :split_request_size_check?
|
308
|
+
end
|
309
|
+
end
|
299
310
|
end
|
300
311
|
|
301
312
|
def placeholder?(name, param)
|
@@ -592,7 +603,7 @@ EOC
|
|
592
603
|
|
593
604
|
if append_record_to_messages(@write_operation, meta, header, record, bulk_message[info])
|
594
605
|
bulk_message_count[info] += 1;
|
595
|
-
if bulk_message
|
606
|
+
if split_request?(bulk_message, info)
|
596
607
|
bulk_message.each do |info, msgs|
|
597
608
|
send_bulk(msgs, tag, chunk, bulk_message_count[info], extracted_values, info) unless msgs.empty?
|
598
609
|
msgs.clear
|
@@ -619,6 +630,18 @@ EOC
|
|
619
630
|
end
|
620
631
|
end
|
621
632
|
|
633
|
+
def split_request?(bulk_message, info)
|
634
|
+
# For safety.
|
635
|
+
end
|
636
|
+
|
637
|
+
def split_request_size_check?(bulk_message, info)
|
638
|
+
bulk_message[info].size > @bulk_message_request_threshold
|
639
|
+
end
|
640
|
+
|
641
|
+
def split_request_size_uncheck?(bulk_message, info)
|
642
|
+
false
|
643
|
+
end
|
644
|
+
|
622
645
|
def process_message(tag, meta, header, time, record, extracted_values)
|
623
646
|
logstash_prefix, index_name, type_name = extracted_values
|
624
647
|
|
@@ -1083,6 +1083,27 @@ class ElasticsearchOutput < Test::Unit::TestCase
|
|
1083
1083
|
assert_requested(request, times: 2)
|
1084
1084
|
end
|
1085
1085
|
|
1086
|
+
def test_writes_with_huge_records_but_uncheck
|
1087
|
+
driver.configure(Fluent::Config::Element.new(
|
1088
|
+
'ROOT', '', {
|
1089
|
+
'@type' => 'elasticsearch',
|
1090
|
+
'bulk_message_request_threshold' => -1,
|
1091
|
+
}, [
|
1092
|
+
Fluent::Config::Element.new('buffer', 'tag', {
|
1093
|
+
'chunk_keys' => ['tag', 'time'],
|
1094
|
+
'chunk_limit_size' => '64MB',
|
1095
|
+
}, [])
|
1096
|
+
]
|
1097
|
+
))
|
1098
|
+
request = stub_elastic
|
1099
|
+
driver.run(default_tag: 'test') do
|
1100
|
+
driver.feed(sample_record('huge_record' => ("a" * 20 * 1024 * 1024)))
|
1101
|
+
driver.feed(sample_record('huge_record' => ("a" * 20 * 1024 * 1024)))
|
1102
|
+
end
|
1103
|
+
assert_false(driver.instance.split_request?({}, nil))
|
1104
|
+
assert_requested(request, times: 1)
|
1105
|
+
end
|
1106
|
+
|
1086
1107
|
class IndexNamePlaceholdersTest < self
|
1087
1108
|
def test_writes_to_speficied_index_with_tag_placeholder
|
1088
1109
|
driver.configure("index_name myindex.${tag}\n")
|
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.5.
|
4
|
+
version: 3.5.1
|
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: 2019-05-
|
12
|
+
date: 2019-05-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|