Class: Fluent::IRCOutput
- Inherits:
-
Output
- Object
- Output
- Fluent::IRCOutput
- Includes:
- SetTagKeyMixin, SetTimeKeyMixin
- Defined in:
- lib/fluent/plugin/out_irc.rb
Defined Under Namespace
Classes: IRCConnection
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #emit(tag, es, chain) ⇒ Object
-
#initialize ⇒ IRCOutput
constructor
A new instance of IRCOutput.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ IRCOutput
Returns a new instance of IRCOutput.
27 28 29 30 |
# File 'lib/fluent/plugin/out_irc.rb', line 27 def initialize super require 'irc_parser' end |
Instance Method Details
#configure(conf) ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/fluent/plugin/out_irc.rb', line 32 def configure(conf) super begin % (['1'] * @out_keys.length) rescue ArgumentError raise Fluent::ConfigError, "string specifier '%s' and out_keys specification mismatch" end end |
#emit(tag, es, chain) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/fluent/plugin/out_irc.rb', line 56 def emit(tag, es, chain) chain.next if @conn.closed? refresh_connection(@conn) end es.each do |time,record| filter_record(tag, time, record) @conn.((record)) end end |
#shutdown ⇒ Object
51 52 53 54 |
# File 'lib/fluent/plugin/out_irc.rb', line 51 def shutdown super @conn.close unless @conn.closed? end |
#start ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/fluent/plugin/out_irc.rb', line 41 def start super begin @conn = create_connection rescue raise Fluent::ConfigError, "failto connect IRC server #{@host}:#{@port}" end end |