Merge pull request #1111 from ronnocol/master

Close LOGSTASH-1933:
This commit is contained in:
Aaron Mildenstein 2014-02-24 15:24:56 -06:00
commit d62bffe3aa

View file

@ -43,6 +43,12 @@ class LogStash::Outputs::Irc < LogStash::Outputs::Base
# Limit the rate of messages sent to IRC in messages per second.
config :messages_per_second, :validate => :number, :default => 0.5
# Static string before event
config :pre_string, :validate => :string, :required => false
# Static string after event
config :post_string, :validate => :string, :required => false
public
def register
require "cinch"
@ -74,7 +80,9 @@ class LogStash::Outputs::Irc < LogStash::Outputs::Base
text = event.sprintf(@format)
@bot.channels.each do |channel|
@logger.debug("Sending to...", :channel => channel, :text => text)
channel.msg(pre_string) if !@pre_string.nil?
channel.msg(text)
channel.msg(post_string) if !@post_string.nil?
end # channels.each
end # def receive
end # class LogStash::Outputs::Irc