Skip to content

Commit

Permalink
Merge pull request elastic#1111 from ronnocol/master
Browse files Browse the repository at this point in the history
Close LOGSTASH-1933:
  • Loading branch information
untergeek committed Feb 24, 2014
2 parents 9e159c6 + 0ba3cc2 commit d62bffe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/logstash/outputs/irc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -74,7 +80,9 @@ def receive(event)
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

0 comments on commit d62bffe

Please sign in to comment.