Class: LogStash::Modules::Scaffold
- Inherits:
-
Object
- Object
- LogStash::Modules::Scaffold
- Includes:
- Util::Loggable
- Defined in:
- lib/logstash/modules/scaffold.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#elasticsearch_configuration ⇒ Object
readonly
Returns the value of attribute elasticsearch_configuration.
-
#kibana_configuration ⇒ Object
readonly
Returns the value of attribute kibana_configuration.
-
#logstash_configuration ⇒ Object
readonly
Returns the value of attribute logstash_configuration.
-
#module_name ⇒ Object
readonly
Returns the value of attribute module_name.
Instance Method Summary collapse
- #config_string ⇒ Object
- #import(import_engine) ⇒ Object
-
#initialize(name, directory) ⇒ Scaffold
constructor
A new instance of Scaffold.
- #with_settings(module_settings) ⇒ Object
Methods included from Util::Loggable
included, #logger, #slow_logger
Constructor Details
#initialize(name, directory) ⇒ Scaffold
Returns a new instance of Scaffold.
15 16 17 18 |
# File 'lib/logstash/modules/scaffold.rb', line 15 def initialize(name, directory) @module_name = name @directory = directory # this is the 'configuration folder in the GEM root.' end |
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
13 14 15 |
# File 'lib/logstash/modules/scaffold.rb', line 13 def directory @directory end |
#elasticsearch_configuration ⇒ Object (readonly)
Returns the value of attribute elasticsearch_configuration.
13 14 15 |
# File 'lib/logstash/modules/scaffold.rb', line 13 def elasticsearch_configuration @elasticsearch_configuration end |
#kibana_configuration ⇒ Object (readonly)
Returns the value of attribute kibana_configuration.
13 14 15 |
# File 'lib/logstash/modules/scaffold.rb', line 13 def kibana_configuration @kibana_configuration end |
#logstash_configuration ⇒ Object (readonly)
Returns the value of attribute logstash_configuration.
13 14 15 |
# File 'lib/logstash/modules/scaffold.rb', line 13 def logstash_configuration @logstash_configuration end |
#module_name ⇒ Object (readonly)
Returns the value of attribute module_name.
13 14 15 |
# File 'lib/logstash/modules/scaffold.rb', line 13 def module_name @module_name end |
Instance Method Details
#config_string ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/logstash/modules/scaffold.rb', line 36 def config_string() # settings should be set earlier by the caller. # settings should be the subset from the YAML file with a structure like # {"name" => "plugin name", "k1" => "v1", "k2" => "v2"}, etc. return nil if @logstash_configuration.nil? @logstash_configuration.config_string end |
#import(import_engine) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/logstash/modules/scaffold.rb', line 20 def import(import_engine) @elasticsearch_configuration.resources.each do |resource| import_engine.put(resource) end @kibana_configuration.resources.each do |resource| import_engine.put(resource) end end |
#with_settings(module_settings) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/logstash/modules/scaffold.rb', line 29 def with_settings(module_settings) @logstash_configuration = LogStashConfig.new(self, module_settings) @kibana_configuration = KibanaConfig.new(self, module_settings) @elasticsearch_configuration = ElasticsearchConfig.new(self, module_settings) self end |