Class: Fluent::Plugin::UDPForwardInput
- Inherits:
-
Input
- Object
- Input
- Fluent::Plugin::UDPForwardInput
- Defined in:
- lib/fluent/plugin/in_udp_forward.rb
Instance Method Summary collapse
Instance Method Details
#configure(conf) ⇒ Object
13 14 15 |
# File 'lib/fluent/plugin/in_udp_forward.rb', line 13 def configure(conf) super end |
#multi_workers_ready? ⇒ Boolean
17 18 19 |
# File 'lib/fluent/plugin/in_udp_forward.rb', line 17 def multi_workers_ready? true end |
#shutdown ⇒ Object
41 42 43 44 |
# File 'lib/fluent/plugin/in_udp_forward.rb', line 41 def shutdown super @thread.kill end |
#start ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/fluent/plugin/in_udp_forward.rb', line 21 def start super $log.info("udp_forward listening on #{@bind}:#{@port}") @thread = Thread.new(Thread.current) do |parent| while (true) begin Socket.udp_server_loop(@bind, @port) do |msg, msg_src| tag, time, record = parse(msg) router.emit(tag, time, record) end rescue $log.error("unexpected error in udp_server_loop", :error=>$!.to_s) $log.error_backtrace end end end end |