mirror of
https://github.com/elastic/logstash.git
synced 2025-04-25 07:07:54 -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.
|
# Limit the rate of messages sent to IRC in messages per second.
|
||||||
config :messages_per_second, :validate => :number, :default => 0.5
|
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
|
public
|
||||||
def register
|
def register
|
||||||
require "cinch"
|
require "cinch"
|
||||||
|
@ -74,7 +80,9 @@ class LogStash::Outputs::Irc < LogStash::Outputs::Base
|
||||||
text = event.sprintf(@format)
|
text = event.sprintf(@format)
|
||||||
@bot.channels.each do |channel|
|
@bot.channels.each do |channel|
|
||||||
@logger.debug("Sending to...", :channel => channel, :text => text)
|
@logger.debug("Sending to...", :channel => channel, :text => text)
|
||||||
|
channel.msg(pre_string) if !@pre_string.nil?
|
||||||
channel.msg(text)
|
channel.msg(text)
|
||||||
|
channel.msg(post_string) if !@post_string.nil?
|
||||||
end # channels.each
|
end # channels.each
|
||||||
end # def receive
|
end # def receive
|
||||||
end # class LogStash::Outputs::Irc
|
end # class LogStash::Outputs::Irc
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue