Class: LogStash::Outputs::Elasticsearch::Protocols::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/outputs/elasticsearch/protocol.rb

Direct Known Subclasses

HTTPClient, NodeClient

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



9
10
11
12
# File 'lib/logstash/outputs/elasticsearch/protocol.rb', line 9

def initialize(options={})
  # host(s), port, cluster
  @logger = Cabin::Channel.get
end

Instance Method Details

#template_install(name, template, force = false) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/logstash/outputs/elasticsearch/protocol.rb', line 21

def template_install(name, template, force=false)
  if template_exists?(name) && !force
    @logger.debug("Found existing Elasticsearch template. Skipping template management", :name => name)
    return
  end
  template_put(name, template)
end