Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/logstash/outputs/elasticsearch/http_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,15 @@ def bulk_send(body_stream, batch_actions)

case response.code
when 200 # OK
LogStash::Json.load(response.body)
body = response.body
if body[0..40].match?(/"errors":false/) && ENV["SHORT_CIRCUIT"] == "1"
# fake a successful bulk response
# {"took":7, "errors": false, "items":[{"index":{"_index":"test","_id":"1","_version":1,"result":"created","forced_refresh":false}}]}
{"errors": false, "items": []}
else
LogStash::Json.load(body)
end

when 413 # Payload Too Large
logger.warn("Bulk request rejected: `413 Payload Too Large`", :action_count => batch_actions.size, :content_length => body_stream.size)
emulate_batch_error_response(batch_actions, response.code, 'payload_too_large')
Expand Down