fluent-plugin-elasticsearch 2.11.9 → 2.11.10
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1cebf3b8220407620d42104808fd3a1d7a498d4a5cbfe51c0711090bcfd0cbd
|
4
|
+
data.tar.gz: ff35d230ca178b9f5bc064e03b72aa9cd9adb88206e7ea30dbf99364ceb067b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f51bdbe47a354dfaf647fd852f06d8b650cedc5dd6416e4120f3160d075bd3e3a86debb2c5bc3ca14c4988ac06103b884d05070a13f48eefde5e65afdc99b9c
|
7
|
+
data.tar.gz: 79d52981b4f25213441b70c71acfcc1ccd6ebdba851a40d4576e5b2a1eca09b14ce5d1ec8e206aa48439392cb0a022a0e9ed158634bd6200a88e9cc4e1aebf41
|
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.11.
|
6
|
+
s.version = '2.11.10'
|
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}
|
@@ -73,7 +73,16 @@ class Fluent::Plugin::ElasticsearchErrorHandler
|
|
73
73
|
stats[:duplicates] += 1
|
74
74
|
when 400 == status
|
75
75
|
stats[:bad_argument] += 1
|
76
|
-
|
76
|
+
reason = ""
|
77
|
+
@plugin.log.on_debug do
|
78
|
+
if item[write_operation].has_key?('error') && item[write_operation]['error'].has_key?('type')
|
79
|
+
reason = " [error type]: #{item[write_operation]['error']['type']}"
|
80
|
+
end
|
81
|
+
if item[write_operation].has_key?('error') && item[write_operation]['error'].has_key?('reason')
|
82
|
+
reason += " [reason]: \'#{item[write_operation]['error']['reason']}\'"
|
83
|
+
end
|
84
|
+
end
|
85
|
+
@plugin.router.emit_error_event(tag, time, rawrecord, ElasticsearchError.new("400 - Rejected by Elasticsearch#{reason}"))
|
77
86
|
else
|
78
87
|
if item[write_operation].has_key?('error') && item[write_operation]['error'].has_key?('type')
|
79
88
|
type = item[write_operation]['error']['type']
|
@@ -58,6 +58,47 @@ class TestElasticsearchErrorHandler < Test::Unit::TestCase
|
|
58
58
|
JSON.parse(value)
|
59
59
|
end
|
60
60
|
|
61
|
+
class TEST400ResponseReason < self
|
62
|
+
def setup
|
63
|
+
Fluent::Test.setup
|
64
|
+
@log_device = Fluent::Test::DummyLogDevice.new
|
65
|
+
dl_opts = {:log_level => ServerEngine::DaemonLogger::DEBUG}
|
66
|
+
logger = ServerEngine::DaemonLogger.new(@log_device, dl_opts)
|
67
|
+
@log = Fluent::Log.new(logger)
|
68
|
+
@plugin = TestPlugin.new(@log)
|
69
|
+
@handler = Fluent::Plugin::ElasticsearchErrorHandler.new(@plugin)
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_400_responses_reason_log
|
73
|
+
records = [{time: 123, record: {"foo" => "bar", '_id' => 'abc'}}]
|
74
|
+
response = parse_response(%({
|
75
|
+
"took" : 0,
|
76
|
+
"errors" : true,
|
77
|
+
"items" : [
|
78
|
+
{
|
79
|
+
"create" : {
|
80
|
+
"_index" : "foo",
|
81
|
+
"status" : 400,
|
82
|
+
"error" : {
|
83
|
+
"type" : "mapper_parsing_exception",
|
84
|
+
"reason" : "failed to parse"
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
]
|
89
|
+
}))
|
90
|
+
chunk = MockChunk.new(records)
|
91
|
+
dummy_extracted_values = []
|
92
|
+
@handler.handle_error(response, 'atag', chunk, records.length, dummy_extracted_values)
|
93
|
+
assert_equal(1, @plugin.error_events.size)
|
94
|
+
expected_log = "failed to parse"
|
95
|
+
exception_message = @plugin.error_events.first[:error].message
|
96
|
+
assert_true(exception_message.include?(expected_log),
|
97
|
+
"Exception do not contain '#{exception_message}' '#{expected_log}'")
|
98
|
+
assert_true(@plugin.error_events[0][:error].respond_to?(:backtrace))
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
61
102
|
def test_dlq_400_responses
|
62
103
|
records = [{time: 123, record: {"foo" => "bar", '_id' => 'abc'}}]
|
63
104
|
response = parse_response(%({
|
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.11.
|
4
|
+
version: 2.11.10
|
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-09-
|
12
|
+
date: 2018-09-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|