fluent-plugin-elasticsearch 1.17.2 → 1.18.0

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: 331ba0c76606e47fa96214c432b7c67bdeda5440cb45c8689f9b63052f372ec1
4
- data.tar.gz: 68a57f20ce85df802931dc206c52874acb8bf8d49d5d30c020f43a295a8ffe26
3
+ metadata.gz: 2e6b46f67805b944adff6414e59f57c384cb02d7609440773ef3ee412bd8cb46
4
+ data.tar.gz: c808857aae2e8566e88c211b3e03b69a7979fca4e09de569be972ba6f3210d5e
5
5
  SHA512:
6
- metadata.gz: 45d64db8c27ba51856ad811ee09c509ee412bd715abfc7d63a1d0314e07d42295256e8b667df8f81ca2c48425cdc87b1a3808712493c7eb27bb0ab05d2706b3c
7
- data.tar.gz: 473bc12ab5f0d3e0748f5ea0a1a419ca584a49b76df603e472411559892bf5c8d7beef25e25913270ad6dba1ac7435982955747f1bc53765c5dd6583e663bf3a
6
+ metadata.gz: be3a97d063b6ddbe4f4fa6cb267e7453341a31a678b8385c197ad25e5eb92dad0503ab92db0a0bdda00b41522944dfd50f11666943f5af3f76044551d423a137
7
+ data.tar.gz: f2ae3e1a47fc1567aa82fa79127717b53b5765b97d71cfb02564d76671ee9376ef8626c9e4bae7c8a65d68c114ecbe5436e6902d52630658dcb4ca9e08ff3396
data/History.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ### [Unreleased]
4
4
 
5
+ ### 1.18.0
6
+ - Avoid NoMethodError on unknown Elasticsearch error responses (#487)
7
+
5
8
  ### 1.17.2
6
9
  - add simple sniffer for simple proxy/lb cases (#459)
7
10
 
@@ -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 = '1.17.2'
6
+ s.version = '1.18.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}
@@ -63,8 +63,8 @@ class Fluent::ElasticsearchErrorHandler
63
63
  stats[:bad_argument] += 1
64
64
  @plugin.router.emit_error_event(tag, time, rawrecord, ElasticsearchError.new('400 - Rejected by Elasticsearch'))
65
65
  else
66
- if item[write_operation].has_key?('error') && item[write_operation]['error'].has_key?('type')
67
- type = item[write_operation]['error']['type']
66
+ type = item[write_operation].fetch('error', {})['type']
67
+ if type
68
68
  stats[type] += 1
69
69
  retry_stream.add(time, rawrecord)
70
70
  else
@@ -195,4 +195,26 @@ class TestElasticsearchErrorHandler < Test::Unit::TestCase
195
195
 
196
196
  end
197
197
 
198
+ def test_old_es_1_X_responses
199
+ records = [{time: 123, record: {"foo" => "bar", '_id' => 'abc'}}]
200
+ response = parse_response(%({
201
+ "took" : 0,
202
+ "errors" : true,
203
+ "items" : [
204
+ {
205
+ "create" : {
206
+ "_index" : "foo",
207
+ "status" : 429,
208
+ "_type" : "bar",
209
+ "error" : "some unrecognized error"
210
+ }
211
+ }
212
+ ]
213
+ }))
214
+ chunk = MockChunk.new(records)
215
+ @handler.handle_error(response, 'atag', chunk, records.length)
216
+ assert_equal(1, @plugin.error_events.size)
217
+ assert_true(@plugin.error_events[0][:error].respond_to?(:backtrace))
218
+ end
219
+
198
220
  end
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: 1.17.2
4
+ version: 1.18.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: 2018-08-11 00:00:00.000000000 Z
12
+ date: 2018-10-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd