Class: SumologicConnection
- Inherits:
-
Object
- Object
- SumologicConnection
- Defined in:
- lib/fluent/plugin/out_sumologic.rb
Instance Attribute Summary collapse
-
#http ⇒ Object
readonly
Returns the value of attribute http.
Instance Method Summary collapse
-
#initialize(endpoint, verify_ssl, connect_timeout) ⇒ SumologicConnection
constructor
A new instance of SumologicConnection.
- #publish(raw_data, source_host = nil, source_category = nil, source_name = nil) ⇒ Object
Constructor Details
#initialize(endpoint, verify_ssl, connect_timeout) ⇒ SumologicConnection
Returns a new instance of SumologicConnection.
10 11 12 13 |
# File 'lib/fluent/plugin/out_sumologic.rb', line 10 def initialize(endpoint, verify_ssl, connect_timeout) @endpoint = endpoint create_http_client(verify_ssl, connect_timeout) end |
Instance Attribute Details
#http ⇒ Object (readonly)
Returns the value of attribute http.
8 9 10 |
# File 'lib/fluent/plugin/out_sumologic.rb', line 8 def http @http end |
Instance Method Details
#publish(raw_data, source_host = nil, source_category = nil, source_name = nil) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/fluent/plugin/out_sumologic.rb', line 15 def publish(raw_data, source_host=nil, source_category=nil, source_name=nil) response = http.post(@endpoint, raw_data, request_headers(source_host, source_category, source_name)) unless response.ok? raise "Failed to send data to HTTP Source. #{response.code} - #{response.body}" end end |