Class: LogStash::PipelineSettings

Inherits:
Settings
  • Object
show all
Defined in:
lib/logstash/pipeline_settings.rb

Constant Summary collapse

SETTINGS_WHITE_LIST =

there are settings that the pipeline uses and can be changed per pipeline instance

[
  "config.debug",
  "config.support_escapes",
  "config.reload.automatic",
  "config.reload.interval",
  "config.string",
  "dead_letter_queue.enable",
  "dead_letter_queue.max_bytes",
  "metric.collect",
  "pipeline.java_execution",
  "path.config",
  "path.dead_letter_queue",
  "path.queue",
  "pipeline.batch.delay",
  "pipeline.batch.size",
  "pipeline.id",
  "pipeline.reloadable",
  "pipeline.system",
  "pipeline.workers",
  "queue.checkpoint.acks",
  "queue.checkpoint.interval",
  "queue.checkpoint.writes",
  "queue.checkpoint.retry",
  "queue.drain",
  "queue.max_bytes",
  "queue.max_events",
  "queue.page_capacity",
  "queue.type",
]

Constants included from Util::SubstitutionVariables

Util::SubstitutionVariables::SUBSTITUTION_PLACEHOLDER_REGEX

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Settings

#==, #clone, #format_settings, #from_yaml, #get_default, #get_setting, #get_subset, #get_value, #initialize, #merge, #on_post_process, #post_process, #registered?, #reset, #set?, #set_value, #to_hash, #validate_all

Methods included from Util::SubstitutionVariables

#deep_replace, #replace_placeholders

Constructor Details

This class inherits a constructor from LogStash::Settings

Class Method Details

.from_settings(settings) ⇒ Object

register a set of settings that is used as the default set of pipelines settings



39
40
41
42
43
44
45
# File 'lib/logstash/pipeline_settings.rb', line 39

def self.from_settings(settings)
  pipeline_settings = self.new
  SETTINGS_WHITE_LIST.each do |setting|
    pipeline_settings.register(settings.get_setting(setting).clone)
  end
  pipeline_settings
end

Instance Method Details

#register(setting) ⇒ Object



47
48
49
50
51
52
# File 'lib/logstash/pipeline_settings.rb', line 47

def register(setting)
  unless SETTINGS_WHITE_LIST.include?(setting.name)
    raise ArgumentError.new("Only pipeline related settings can be registered in a PipelineSettings object. Received \"#{setting.name}\". Allowed settings: #{SETTINGS_WHITE_LIST}")
  end
  super(setting)
end