fluent-plugin-elasticsearch 4.0.5 → 4.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/issue-auto-closer.yml +12 -0
- data/.github/workflows/linux.yml +26 -0
- data/.github/workflows/macos.yml +26 -0
- data/.github/workflows/windows.yml +26 -0
- data/.travis.yml +1 -1
- data/Gemfile +2 -1
- data/History.md +27 -0
- data/README.ElasticsearchGenID.md +116 -0
- data/README.md +99 -28
- data/fluent-plugin-elasticsearch.gemspec +1 -1
- data/gemfiles/Gemfile.elasticsearch.v6 +1 -1
- data/gemfiles/{Gemfile.ilm → Gemfile.without.ilm} +1 -2
- data/lib/fluent/plugin/elasticsearch_index_template.rb +1 -1
- data/lib/fluent/plugin/elasticsearch_tls.rb +3 -3
- data/lib/fluent/plugin/filter_elasticsearch_genid.rb +52 -0
- data/lib/fluent/plugin/out_elasticsearch.rb +76 -36
- data/lib/fluent/plugin/out_elasticsearch_dynamic.rb +6 -4
- data/test/plugin/test_elasticsearch_error_handler.rb +1 -1
- data/test/plugin/test_elasticsearch_index_lifecycle_management.rb +1 -1
- data/test/plugin/test_elasticsearch_tls.rb +2 -2
- data/test/plugin/test_filter_elasticsearch_genid.rb +172 -1
- data/test/plugin/test_in_elasticsearch.rb +1 -1
- data/test/plugin/test_out_elasticsearch.rb +329 -6
- data/test/plugin/test_out_elasticsearch_dynamic.rb +23 -5
- metadata +8 -3
@@ -1,8 +1,9 @@
|
|
1
|
-
|
1
|
+
require_relative '../helper'
|
2
2
|
require 'date'
|
3
3
|
require 'fluent/test/helpers'
|
4
4
|
require 'fluent/test/driver/output'
|
5
5
|
require 'flexmock/test_unit'
|
6
|
+
require 'fluent/plugin/out_elasticsearch_dynamic'
|
6
7
|
|
7
8
|
class ElasticsearchOutputDynamic < Test::Unit::TestCase
|
8
9
|
include FlexMock::TestCase
|
@@ -12,7 +13,6 @@ class ElasticsearchOutputDynamic < Test::Unit::TestCase
|
|
12
13
|
|
13
14
|
def setup
|
14
15
|
Fluent::Test.setup
|
15
|
-
require 'fluent/plugin/out_elasticsearch_dynamic'
|
16
16
|
@driver = nil
|
17
17
|
end
|
18
18
|
|
@@ -101,7 +101,7 @@ class ElasticsearchOutputDynamic < Test::Unit::TestCase
|
|
101
101
|
assert_nil instance.ssl_max_version
|
102
102
|
assert_nil instance.ssl_min_version
|
103
103
|
if Fluent::Plugin::ElasticsearchTLS::USE_TLS_MINMAX_VERSION
|
104
|
-
assert_equal({max_version: OpenSSL::SSL::
|
104
|
+
assert_equal({max_version: OpenSSL::SSL::TLS1_3_VERSION, min_version: OpenSSL::SSL::TLS1_2_VERSION},
|
105
105
|
instance.ssl_version_options)
|
106
106
|
else
|
107
107
|
assert_equal({version: Fluent::Plugin::ElasticsearchTLS::DEFAULT_VERSION},
|
@@ -147,7 +147,16 @@ class ElasticsearchOutputDynamic < Test::Unit::TestCase
|
|
147
147
|
}
|
148
148
|
instance = driver(config).instance
|
149
149
|
|
150
|
-
assert_equal
|
150
|
+
assert_equal nil, instance.client.transport.options[:transport_options][:headers]["Content-Encoding"]
|
151
|
+
|
152
|
+
stub_request(:post, "http://localhost:9200/_bulk").
|
153
|
+
to_return(status: 200, body: "", headers: {})
|
154
|
+
driver.run(default_tag: 'test') do
|
155
|
+
driver.feed(sample_record)
|
156
|
+
end
|
157
|
+
compressable = instance.compressable_connection
|
158
|
+
|
159
|
+
assert_equal "gzip", instance.client(nil, compressable).transport.options[:transport_options][:headers]["Content-Encoding"]
|
151
160
|
end
|
152
161
|
|
153
162
|
test 'check compression option is passed to transport' do
|
@@ -158,7 +167,16 @@ class ElasticsearchOutputDynamic < Test::Unit::TestCase
|
|
158
167
|
}
|
159
168
|
instance = driver(config).instance
|
160
169
|
|
161
|
-
assert_equal
|
170
|
+
assert_equal false, instance.client.transport.options[:compression]
|
171
|
+
|
172
|
+
stub_request(:post, "http://localhost:9200/_bulk").
|
173
|
+
to_return(status: 200, body: "", headers: {})
|
174
|
+
driver.run(default_tag: 'test') do
|
175
|
+
driver.feed(sample_record)
|
176
|
+
end
|
177
|
+
compressable = instance.compressable_connection
|
178
|
+
|
179
|
+
assert_equal true, instance.client(nil, compressable).transport.options[:compression]
|
162
180
|
end
|
163
181
|
|
164
182
|
test 'configure Content-Type' do
|
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.0.
|
4
|
+
version: 4.0.10
|
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-
|
13
|
+
date: 2020-07-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: fluentd
|
@@ -135,6 +135,10 @@ extra_rdoc_files: []
|
|
135
135
|
files:
|
136
136
|
- ".coveralls.yml"
|
137
137
|
- ".editorconfig"
|
138
|
+
- ".github/workflows/issue-auto-closer.yml"
|
139
|
+
- ".github/workflows/linux.yml"
|
140
|
+
- ".github/workflows/macos.yml"
|
141
|
+
- ".github/workflows/windows.yml"
|
138
142
|
- ".gitignore"
|
139
143
|
- ".travis.yml"
|
140
144
|
- CONTRIBUTING.md
|
@@ -143,13 +147,14 @@ files:
|
|
143
147
|
- ISSUE_TEMPLATE.md
|
144
148
|
- LICENSE.txt
|
145
149
|
- PULL_REQUEST_TEMPLATE.md
|
150
|
+
- README.ElasticsearchGenID.md
|
146
151
|
- README.ElasticsearchInput.md
|
147
152
|
- README.md
|
148
153
|
- Rakefile
|
149
154
|
- appveyor.yml
|
150
155
|
- fluent-plugin-elasticsearch.gemspec
|
151
156
|
- gemfiles/Gemfile.elasticsearch.v6
|
152
|
-
- gemfiles/Gemfile.ilm
|
157
|
+
- gemfiles/Gemfile.without.ilm
|
153
158
|
- lib/fluent/log-ext.rb
|
154
159
|
- lib/fluent/plugin/default-ilm-policy.json
|
155
160
|
- lib/fluent/plugin/elasticsearch_constants.rb
|