Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Or install it yourself as:
type sumologic
host collectors.sumologic.com
port 443
proxy 10.0.0.1:3128
format json|text
path /receiver/v1/http/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==
</match>
Expand All @@ -43,6 +44,9 @@ Or install it yourself as:
#### port
- Port of HTTP Collectors URL

#### proxy
- HTTP proxy address including port

#### path
- Path of HTTP Collectors URL

Expand Down
9 changes: 7 additions & 2 deletions lib/fluent/plugin/out_sumologic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Fluent::SumologicOutput< Fluent::BufferedOutput

config_param :host, :string, :default => 'collectors.sumologic.com'
config_param :port, :integer, :default => 443
config_param :proxy, :string, :default => nil
config_param :verify_ssl, :bool, :default => true
config_param :path, :string, :default => '/receiver/v1/http/XXX'
config_param :format, :string, :default => 'json'
Expand Down Expand Up @@ -63,8 +64,12 @@ def write(chunk)
end
end

(proxy,proxy_port) = ENV['http_proxy'].split(':')
http = Net::HTTP::Proxy(proxy,proxy_port).new(@host, @port.to_i)
http = Net::HTTP.new(@host, @port.to_i)
proxy_string = if ENV['http_proxy'] then ENV['http_proxy'] else @proxy end
if(proxy_string){
(proxy,proxy_port) = proxy_string.split(':')
http = Net::HTTP::Proxy(proxy,proxy_port).new(@host, @port.to_i)
}
http.use_ssl = true
http.verify_mode = @verify_ssl ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
http.set_debug_output $stderr
Expand Down