Class: LogStash::Outputs::Stackify

Inherits:
Base
  • Object
show all
Includes:
HttpClient
Defined in:
lib/logstash/outputs/stackify/http_client.rb,
lib/logstash/outputs/stackify.rb

Overview

Use logstash to ship logs to Stackify

Defined Under Namespace

Modules: HttpClient

Constant Summary collapse

CONTENT_TYPE =
"application/json".freeze
MAX_ATTEMPTS =
3
METHOD =
:post.freeze
RETRYABLE_MANTICORE_EXCEPTIONS =
[
    ::Manticore::Timeout,
    ::Manticore::SocketException,
    ::Manticore::ClientProtocolException,
    ::Manticore::ResolutionFailure,
    ::Manticore::SocketTimeout
].freeze
RETRYABLE_CODES =
[429, 500, 502, 503, 504].freeze
URL =
"https://api.stackify.com/Log/Save".freeze

Instance Method Summary collapse

Methods included from HttpClient

#build_http_client_config, #http_client, included, #setup_http_client_config

Instance Method Details

#closeObject



78
79
80
# File 'lib/logstash/outputs/stackify.rb', line 78

def close
  http_client.close
end

#multi_receive(events) ⇒ Object



74
75
76
# File 'lib/logstash/outputs/stackify.rb', line 74

def multi_receive(events)
  send_events(events)
end

#registerObject



63
64
65
66
67
68
69
70
71
72
# File 'lib/logstash/outputs/stackify.rb', line 63

def register
  @headers = {
      "Content-Type" => CONTENT_TYPE,
      "Accept" => CONTENT_TYPE,
      "X-Stackify-PV" => "V1",
      "X-Stackify-Key" => @key.to_s
  }
  @url = URL
  @logger.info("Stackify Plugin Registered")
end