Merge branch 'master' into LOGSTASH-724

This commit is contained in:
Louis Zuckerman 2013-01-10 09:11:46 -05:00
commit 08c20d9c9b
4 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,8 @@
1.1.9 ( January X, 2013 )
## outputs
- fix bug in elasticsearch_river where it wouldn't resolve %{} variables in index
and changed index -> index_type in ES header. (LOGSTASH-819)
1.1.8 (January 3, 2013)
## general
- patched another work around for JRUBY-6970 (LOGSTASH-801)
@ -239,7 +244,7 @@
- improvement: date: subsecond precision on UNIX timestamps is retained on
conversion (#213, Patch by Ralph Meijer)
- improvement: date: Add locale setting; useful for day/month name parsing.
(#100, Patch by Christian Schrder)
(#100, Patch by Christian Schröder)
## outputs
- new: exec: run arbitrary commands based on an event.

View file

@ -99,7 +99,8 @@ class LogStash::Outputs::ElasticSearchHTTP < LogStash::Outputs::Base
end # def receive_bulk
def flush
puts "Flushing #{@queue.count} events"
@logger.debug? && @logger.debug("Flushing events to elasticsearch",
:count => @queue.count)
# If we don't tack a trailing newline at the end, elasticsearch
# doesn't seem to process the last event in this bulk index call.
#

View file

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

View file

@ -18,6 +18,8 @@ describe "LOGSTASH-820" do
sample "<22>Jan 4 07:50:46 mailmaster postfix/policy-spf[9454]: : SPF permerror (Junk encountered in record 'v=spf1 mx a:mail.domain.no ip4:192.168.0.4 <20>all'): Envelope-from: email@domain.no" do
insist { subject["@tags"].include?("_grokparsefailure") } == false
insist { subject["syslog_pri"] } == [ "22" ]
insist { subject["syslog_program"] } == [ "postfix/policy-spf" ]
end
end
end