Class: Fluent::SplunkHECOutput
- Inherits:
-
ObjectBufferedOutput
- Object
- ObjectBufferedOutput
- Fluent::SplunkHECOutput
- Defined in:
- lib/fluent/plugin/out_splunk_hec.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #shutdown ⇒ Object
- #start ⇒ Object
-
#use_ssl ⇒ Object
For SSL.
- #write_objects(_tag, chunk) ⇒ Object
Instance Method Details
#configure(conf) ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/fluent/plugin/out_splunk_hec.rb', line 52 def configure(conf) super raise ConfigError, "'channel' parameter is required when 'use_ack' is true" if @use_ack && !@channel raise ConfigError, "'ack_interval' parameter must be a non negative integer" if @use_ack && @ack_interval < 0 raise ConfigError, "'event_key' parameter is required when 'raw' is true" if @raw && !@event_key raise ConfigError, "'channel' parameter is required when 'raw' is true" if @raw && !@channel @default_sourcetype = @sourcetype if @sourcetype && !@default_sourcetype # build hash for query string if @raw @query = {} @query['host'] = @default_host if @default_host @query['source'] = @default_source if @default_source @query['index'] = @default_index if @default_index @query['sourcetype'] = @default_sourcetype if @default_sourcetype end end |
#shutdown ⇒ Object
76 77 78 |
# File 'lib/fluent/plugin/out_splunk_hec.rb', line 76 def shutdown super end |
#start ⇒ Object
71 72 73 74 |
# File 'lib/fluent/plugin/out_splunk_hec.rb', line 71 def start setup_client super end |
#use_ssl ⇒ Object
For SSL
45 |
# File 'lib/fluent/plugin/out_splunk_hec.rb', line 45 config_param :use_ssl, :bool, default: false |
#write_objects(_tag, chunk) ⇒ Object
80 81 82 83 84 85 86 87 88 |
# File 'lib/fluent/plugin/out_splunk_hec.rb', line 80 def write_objects(_tag, chunk) return if chunk.empty? payload = '' chunk.msgpack_each do |time, record| payload << (@raw ? format_event_raw(record) : format_event(time, record)) end post_payload(payload) unless payload.empty? end |