- fix @document_id check (found by tests)

This commit is contained in:
Jordan Sissel 2012-12-31 15:00:49 -08:00
parent 62fea57657
commit ca9c4a400d
2 changed files with 2 additions and 2 deletions

View file

@ -89,7 +89,7 @@ class LogStash::Outputs::ElasticSearchHTTP < LogStash::Outputs::Base
def receive_bulk(event, index, type)
header = { "index" => { "_index" => index, "_type" => type } }
if @document_id.nil?
if !@document_id.nil?
header["index"]["_id"] = event.sprintf(@document_id)
end
@queue << [

View file

@ -207,7 +207,7 @@ class LogStash::Outputs::ElasticSearchRiver < LogStash::Outputs::Base
# "action\ndata\n"
# where 'action' is index or delete, data is the data to index.
header = { "index" => { "_index" => index, "_type" => type } }
if @document_id.nil?
if !@document_id.nil?
header["index"]["_id"] = event.sprintf(@document_id)
end