mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
commit
d62bffe3aa
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue