Class: LogStash::Inputs::ElasticServerlessForwarder

Inherits:
Base
  • Object
show all
Includes:
PluginMixins::NormalizeConfigSupport, PluginMixins::PluginFactorySupport
Defined in:
lib/logstash/inputs/elastic_serverless_forwarder.rb

Defined Under Namespace

Classes: QueueWrapper

Instance Method Summary collapse

Constructor Details

#initialize(*a) ⇒ ElasticServerlessForwarder

Returns a new instance of ElasticServerlessForwarder.



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/logstash/inputs/elastic_serverless_forwarder.rb', line 44

def initialize(*a)
  super

  normalize_ssl_configs!

  if original_params.include?('codec')
    fail LogStash::ConfigurationError, 'The `elastic_serverless_forwarder` input does not have an externally-configurable `codec`'
  end

  @internal_http = plugin_factory.input('http').new(inner_http_input_options)
end

Instance Method Details

#closeObject



78
79
80
81
82
# File 'lib/logstash/inputs/elastic_serverless_forwarder.rb', line 78

def close
  logger.debug("closing inner HTTP input plugin")
  @internal_http.close
  logger.debug('inner HTTP plugin has been closed')
end

#registerObject



56
57
58
59
60
# File 'lib/logstash/inputs/elastic_serverless_forwarder.rb', line 56

def register
  logger.debug("registering inner HTTP input plugin")
  @internal_http.register
  logger.debug("registered inner HTTP input plugin")
end

#run(queue) ⇒ Object



63
64
65
66
67
68
69
70
# File 'lib/logstash/inputs/elastic_serverless_forwarder.rb', line 63

def run(queue)
  logger.debug("starting inner HTTP input plugin")
  @internal_http.run(QueueWrapper.new(queue))
  logger.debug('inner HTTP plugin has exited')
rescue => e
  logger.error("inner HTTP plugin has had an unrecoverable exception: #{e.message} at #{e.backtrace.first}")
  raise
end

#stopObject



72
73
74
75
76
# File 'lib/logstash/inputs/elastic_serverless_forwarder.rb', line 72

def stop
  logger.debug("stopping inner HTTP input plugin")
  @internal_http.stop
  logger.debug('inner HTTP plugin has been stopped')
end