Class: Fluent::Plugin::SflowInput

Inherits:
Input
  • Object
show all
Defined in:
lib/fluent/plugin/in_sflow.rb

Instance Method Summary collapse

Instance Method Details

#configure(conf) ⇒ Object



25
26
27
28
29
30
# File 'lib/fluent/plugin/in_sflow.rb', line 25

def configure(conf)
  super

  # dummy data
  $switch_hash = {}
end

#shutdownObject



41
42
43
# File 'lib/fluent/plugin/in_sflow.rb', line 41

def shutdown
  super
end

#startObject



32
33
34
35
36
37
38
39
# File 'lib/fluent/plugin/in_sflow.rb', line 32

def start
  super

  server_create(:in_sflow_server, @port, bind: @bind, proto: :udp, max_bytes: 2048) do |data, sock|
    sflow = SflowParser.parse_packet(data)
    router.emit(@tag, Fluent::EventTime.now, sflow)
  end
end