Class: LogStash::Modules::ElasticsearchConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/modules/elasticsearch_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(modul, settings) ⇒ ElasticsearchConfig

We name it ‘modul` here because `module` has meaning in Ruby.



8
9
10
11
12
13
14
# File 'lib/logstash/modules/elasticsearch_config.rb', line 8

def initialize(modul, settings)
  @directory = ::File.join(modul.directory, "elasticsearch")
  @name = modul.module_name
  @settings = settings
  @full_path = ::File.join(@directory, "#{@name}.json")
  @index_name = @settings.fetch("elasticsearch.template_path", "_template")
end

Instance Attribute Details

#index_nameObject (readonly)

Returns the value of attribute index_name.



5
6
7
# File 'lib/logstash/modules/elasticsearch_config.rb', line 5

def index_name
  @index_name
end

Instance Method Details

#resourcesObject



16
17
18
# File 'lib/logstash/modules/elasticsearch_config.rb', line 16

def resources
  [ElasticsearchResource.new(@index_name, "not-used", @full_path)]
end