Skip to content

Commit 60d464b

Browse files
committed
Switched error message to regexp matching from text comparison
1 parent 556d045 commit 60d464b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/logstash/codecs/json_lines.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def decode(data, &block)
7070
parse_json(@converter.convert(line), &block)
7171
end
7272
rescue java.lang.IllegalStateException => e
73-
if e.message == "input buffer full" && @decode_size_limit_bytes != "none"
73+
if /^input buffer full/ =~ e.message && @decode_size_limit_bytes != "none"
7474
yield event_factory.new_event("message" => "Payload bigger than #{@decode_size_limit_bytes} bytes", "tags" => ["_jsonparsetoobigfailure"])
7575
else
7676
# re-raise the error if doesn't correspond to the buffer overflow condition

0 commit comments

Comments
 (0)