Class: LogStash::Config::Source::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/config/source/base.rb

Direct Known Subclasses

Local, Modules

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ Base

Returns a new instance of Base.



6
7
8
9
# File 'lib/logstash/config/source/base.rb', line 6

def initialize(settings)
  @settings = settings
  @conflict_messages = []
end

Instance Attribute Details

#conflict_messagesObject (readonly)

Returns the value of attribute conflict_messages.



4
5
6
# File 'lib/logstash/config/source/base.rb', line 4

def conflict_messages
  @conflict_messages
end

Instance Method Details

#both_module_configs?Boolean

Returns:

  • (Boolean)


83
84
85
# File 'lib/logstash/config/source/base.rb', line 83

def both_module_configs?
  modules_cli? && modules?
end

#config_conflict?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/logstash/config/source/base.rb', line 19

def config_conflict?
  raise NotImplementedError, "`config_conflict?` must be implemented!"
end

#config_pathObject



51
52
53
# File 'lib/logstash/config/source/base.rb', line 51

def config_path
  config_path_setting.value
end

#config_path?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/logstash/config/source/base.rb', line 55

def config_path?
  !(config_path.nil? || config_path.empty?)
end

#config_path_settingObject



47
48
49
# File 'lib/logstash/config/source/base.rb', line 47

def config_path_setting
  @settings.get_setting("path.config")
end

#config_reload_automaticObject



27
28
29
# File 'lib/logstash/config/source/base.rb', line 27

def config_reload_automatic
  config_reload_automatic_setting.value
end

#config_reload_automatic?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/logstash/config/source/base.rb', line 31

def config_reload_automatic?
  config_reload_automatic_setting.set?
end

#config_reload_automatic_settingObject



23
24
25
# File 'lib/logstash/config/source/base.rb', line 23

def config_reload_automatic_setting
  @settings.get_setting("config.reload.automatic")
end

#config_stringObject



39
40
41
# File 'lib/logstash/config/source/base.rb', line 39

def config_string
  config_string_setting.value
end

#config_string?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/logstash/config/source/base.rb', line 43

def config_string?
  !config_string.nil?
end

#config_string_settingObject



35
36
37
# File 'lib/logstash/config/source/base.rb', line 35

def config_string_setting
  @settings.get_setting("config.string")
end

#match?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/logstash/config/source/base.rb', line 15

def match?
  raise NotImplementedError, "`match?` must be implemented!"
end

#modulesObject



75
76
77
# File 'lib/logstash/config/source/base.rb', line 75

def modules
  modules_setting.value
end

#modules?Boolean

Returns:

  • (Boolean)


79
80
81
# File 'lib/logstash/config/source/base.rb', line 79

def modules?
  !(modules.nil? || modules.empty?)
end

#modules_cliObject



63
64
65
# File 'lib/logstash/config/source/base.rb', line 63

def modules_cli
  modules_cli_setting.value
end

#modules_cli?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/logstash/config/source/base.rb', line 67

def modules_cli?
  !(modules_cli.nil? || modules_cli.empty?)
end

#modules_cli_settingObject



59
60
61
# File 'lib/logstash/config/source/base.rb', line 59

def modules_cli_setting
  @settings.get_setting("modules.cli")
end

#modules_defined?Boolean

Returns:

  • (Boolean)


87
88
89
# File 'lib/logstash/config/source/base.rb', line 87

def modules_defined?
  modules_cli? || modules?
end

#modules_settingObject



71
72
73
# File 'lib/logstash/config/source/base.rb', line 71

def modules_setting
  @settings.get_setting("modules")
end

#pipeline_configsObject

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/logstash/config/source/base.rb', line 11

def pipeline_configs
  raise NotImplementedError, "`#pipeline_configs` must be implemented!"
end