lib/logstash/outputs/statsd.rb in logstash-output-statsd-3.1.5 vs lib/logstash/outputs/statsd.rb in logstash-output-statsd-3.2.0
- old
+ new
@@ -55,10 +55,13 @@
config :host, :validate => :string, :default => "localhost"
# The port to connect to on your statsd server.
config :port, :validate => :number, :default => 8125
+ # The protocol to use for the connection.
+ config :protocol, :validate => ['udp', 'tcp'], :default => "udp"
+
# The statsd namespace to use for this metric. `%{fieldname}` substitutions are
# allowed.
config :namespace, :validate => :string, :default => "logstash"
# The name of the sender. Dots will be replaced with underscores. `%{fieldname}`
@@ -93,10 +96,10 @@
config :sample_rate, :validate => :number, :default => 1
public
def register
require "statsd"
- @client = Statsd.new(@host, @port)
+ @client = Statsd.new(@host, @port, @protocol.to_sym)
end # def register
public
def receive(event)