logstash-core 6.3.2-java → 6.4.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/lib/logstash/agent.rb +10 -6
  3. data/lib/logstash/api/modules/logging.rb +4 -0
  4. data/lib/logstash/api/service.rb +0 -1
  5. data/lib/logstash/bootstrap_check/default_config.rb +0 -2
  6. data/lib/logstash/bootstrap_check/persisted_queue_config.rb +0 -1
  7. data/lib/logstash/codecs/base.rb +2 -4
  8. data/lib/logstash/compiler.rb +2 -3
  9. data/lib/logstash/compiler/lscl.rb +0 -1
  10. data/lib/logstash/config/config_ast.rb +0 -1
  11. data/lib/logstash/config/cpu_core_strategy.rb +0 -1
  12. data/lib/logstash/config/defaults.rb +0 -1
  13. data/lib/logstash/config/file.rb +0 -2
  14. data/lib/logstash/config/mixin.rb +4 -7
  15. data/lib/logstash/config/modules_common.rb +0 -2
  16. data/lib/logstash/config/source/local.rb +1 -3
  17. data/lib/logstash/config/source/modules.rb +0 -2
  18. data/lib/logstash/config/source/multi_local.rb +0 -1
  19. data/lib/logstash/config/source_loader.rb +1 -2
  20. data/lib/logstash/dependency_report.rb +19 -6
  21. data/lib/logstash/elasticsearch_client.rb +0 -2
  22. data/lib/logstash/environment.rb +3 -2
  23. data/lib/logstash/errors.rb +1 -15
  24. data/lib/logstash/event.rb +0 -1
  25. data/lib/logstash/event_dispatcher.rb +1 -40
  26. data/lib/logstash/execution_context.rb +2 -19
  27. data/lib/logstash/filters/base.rb +0 -2
  28. data/lib/logstash/inputs/base.rb +2 -4
  29. data/lib/logstash/inputs/threadable.rb +2 -3
  30. data/lib/logstash/instrument/collector.rb +0 -2
  31. data/lib/logstash/instrument/metric.rb +1 -105
  32. data/lib/logstash/instrument/namespaced_metric.rb +1 -58
  33. data/lib/logstash/instrument/namespaced_null_metric.rb +1 -58
  34. data/lib/logstash/instrument/null_metric.rb +2 -71
  35. data/lib/logstash/instrument/periodic_poller/base.rb +0 -1
  36. data/lib/logstash/instrument/periodic_poller/cgroup.rb +0 -1
  37. data/lib/logstash/java_pipeline.rb +33 -222
  38. data/lib/logstash/json.rb +0 -1
  39. data/lib/logstash/logging.rb +0 -2
  40. data/lib/logstash/logging/logger.rb +1 -159
  41. data/lib/logstash/modules/cli_parser.rb +0 -4
  42. data/lib/logstash/modules/elasticsearch_config.rb +0 -3
  43. data/lib/logstash/modules/elasticsearch_importer.rb +0 -3
  44. data/lib/logstash/modules/elasticsearch_resource.rb +0 -1
  45. data/lib/logstash/modules/file_reader.rb +0 -2
  46. data/lib/logstash/modules/kibana_base.rb +0 -1
  47. data/lib/logstash/modules/kibana_client.rb +0 -2
  48. data/lib/logstash/modules/kibana_config.rb +0 -3
  49. data/lib/logstash/modules/kibana_dashboards.rb +0 -2
  50. data/lib/logstash/modules/kibana_importer.rb +0 -3
  51. data/lib/logstash/modules/kibana_resource.rb +0 -1
  52. data/lib/logstash/modules/kibana_settings.rb +0 -2
  53. data/lib/logstash/modules/logstash_config.rb +0 -1
  54. data/lib/logstash/modules/resource_base.rb +0 -1
  55. data/lib/logstash/modules/scaffold.rb +0 -3
  56. data/lib/logstash/modules/settings_merger.rb +0 -2
  57. data/lib/logstash/namespace.rb +2 -15
  58. data/lib/logstash/outputs/base.rb +3 -5
  59. data/lib/logstash/patches/clamp.rb +6 -0
  60. data/lib/logstash/pipeline.rb +38 -180
  61. data/lib/logstash/pipeline_action/create.rb +0 -2
  62. data/lib/logstash/pipeline_action/reload.rb +1 -4
  63. data/lib/logstash/pipeline_action/stop.rb +0 -2
  64. data/lib/logstash/pipeline_reporter.rb +2 -108
  65. data/lib/logstash/plugin.rb +4 -7
  66. data/lib/logstash/plugins/hooks_registry.rb +1 -63
  67. data/lib/logstash/plugins/registry.rb +3 -2
  68. data/lib/logstash/runner.rb +6 -7
  69. data/lib/logstash/settings.rb +4 -5
  70. data/lib/logstash/shutdown_watcher.rb +0 -119
  71. data/lib/logstash/universal_plugin.rb +1 -13
  72. data/lib/logstash/util.rb +0 -1
  73. data/lib/logstash/util/buftok.rb +1 -139
  74. data/lib/logstash/util/byte_value.rb +2 -3
  75. data/lib/logstash/util/charset.rb +0 -1
  76. data/lib/logstash/util/cloud_setting_auth.rb +0 -1
  77. data/lib/logstash/util/cloud_setting_id.rb +20 -8
  78. data/lib/logstash/util/dead_letter_queue_manager.rb +2 -61
  79. data/lib/logstash/util/decorators.rb +0 -1
  80. data/lib/logstash/util/loggable.rb +1 -31
  81. data/lib/logstash/util/modules_setting_array.rb +2 -2
  82. data/lib/logstash/util/password.rb +0 -1
  83. data/lib/logstash/util/plugin_version.rb +0 -1
  84. data/lib/logstash/util/safe_uri.rb +7 -8
  85. data/lib/logstash/util/secretstore.rb +1 -38
  86. data/lib/logstash/util/substitution_variables.rb +4 -5
  87. data/lib/logstash/util/worker_threads_default_printer.rb +0 -1
  88. data/locales/en.yml +28 -1
  89. data/spec/logstash/config/mixin_spec.rb +4 -4
  90. data/spec/logstash/converge_result_spec.rb +0 -1
  91. data/spec/logstash/event_dispatcher_spec.rb +0 -2
  92. data/spec/logstash/event_spec.rb +22 -26
  93. data/spec/logstash/execution_context_spec.rb +0 -2
  94. data/spec/logstash/filter_delegator_spec.rb +12 -28
  95. data/spec/logstash/inputs/base_spec.rb +4 -5
  96. data/spec/logstash/instrument/metric_spec.rb +0 -1
  97. data/spec/logstash/instrument/namespaced_metric_spec.rb +0 -2
  98. data/spec/logstash/instrument/namespaced_null_metric_spec.rb +1 -3
  99. data/spec/logstash/instrument/null_metric_spec.rb +1 -4
  100. data/spec/logstash/instrument/periodic_poller/base_spec.rb +0 -1
  101. data/spec/logstash/instrument/periodic_poller/os_spec.rb +0 -1
  102. data/spec/logstash/instrument/wrapped_write_client_spec.rb +0 -1
  103. data/spec/logstash/java_filter_delegator_spec.rb +0 -3
  104. data/spec/logstash/java_integration_spec.rb +0 -1
  105. data/spec/logstash/java_pipeline_spec.rb +1 -4
  106. data/spec/logstash/modules/cli_parser_spec.rb +1 -3
  107. data/spec/logstash/modules/scaffold_spec.rb +0 -1
  108. data/spec/logstash/outputs/base_spec.rb +9 -10
  109. data/spec/logstash/pipeline_action/create_spec.rb +2 -3
  110. data/spec/logstash/pipeline_action/reload_spec.rb +1 -2
  111. data/spec/logstash/pipeline_action/stop_spec.rb +0 -1
  112. data/spec/logstash/pipeline_dlq_commit_spec.rb +0 -6
  113. data/spec/logstash/pipeline_reporter_spec.rb +18 -4
  114. data/spec/logstash/pipeline_spec.rb +2 -6
  115. data/spec/logstash/plugin_spec.rb +1 -2
  116. data/spec/logstash/plugins/hooks_registry_spec.rb +0 -2
  117. data/spec/logstash/queue_factory_spec.rb +0 -1
  118. data/spec/logstash/runner_spec.rb +16 -9
  119. data/spec/logstash/settings/modules_spec.rb +3 -3
  120. data/spec/logstash/shutdown_watcher_spec.rb +0 -27
  121. data/spec/logstash/state_resolver_spec.rb +0 -1
  122. data/spec/logstash/util/buftok_spec.rb +0 -1
  123. data/spec/logstash/util/cloud_setting_id_spec.rb +55 -2
  124. data/spec/logstash/util/secretstore_spec.rb +10 -10
  125. data/spec/logstash/util/wrapped_synchronous_queue_spec.rb +2 -2
  126. data/versions-gem-copy.yml +2 -2
  127. metadata +2 -16
  128. data/lib/logstash/bootstrap_check/bad_java.rb +0 -16
  129. data/lib/logstash/bootstrap_check/bad_ruby.rb +0 -12
  130. data/lib/logstash/converge_result.rb +0 -103
  131. data/lib/logstash/instrument/global_metrics.rb +0 -13
  132. data/lib/logstash/instrument/snapshot.rb +0 -15
  133. data/lib/logstash/java_integration.rb +0 -116
  134. data/lib/logstash/logging/json.rb +0 -21
  135. data/lib/logstash/plugins/plugin_factory.rb +0 -107
  136. data/lib/logstash/queue_factory.rb +0 -34
  137. data/lib/logstash/util/retryable.rb +0 -40
  138. data/spec/logstash/output_delegator_spec.rb +0 -201
  139. data/spec/logstash/timestamp_spec.rb +0 -45
@@ -1,13 +1 @@
1
- # encoding: utf-8
2
- module LogStash
3
- class UniversalPlugin
4
- def initialize
5
- end
6
-
7
- def register_hooks(hookManager)
8
- end
9
-
10
- def additionals_settings(settings)
11
- end
12
- end
13
- end
1
+ # Keeping this file for backwards compatibility with plugins that include it directly.
data/lib/logstash/util.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  # encoding: utf-8
2
- require "logstash/namespace"
3
2
  require "logstash/environment"
4
3
 
5
4
  module LogStash::Util
@@ -1,139 +1 @@
1
- # encoding: utf-8
2
- # BufferedTokenizer - Statefully split input data by a specifiable token
3
- #
4
- # Authors:: Tony Arcieri, Martin Emde
5
- #
6
- #----------------------------------------------------------------------------
7
- #
8
- # Copyright (C) 2006-07 by Tony Arcieri and Martin Emde
9
- #
10
- # Distributed under the Ruby license (http://www.ruby-lang.org/en/LICENSE.txt)
11
- #
12
- #---------------------------------------------------------------------------
13
- #
14
-
15
- # (C)2006 Tony Arcieri, Martin Emde
16
- # Distributed under the Ruby license (http://www.ruby-lang.org/en/LICENSE.txt)
17
-
18
- # BufferedTokenizer takes a delimiter upon instantiation, or acts line-based
19
- # by default. It allows input to be spoon-fed from some outside source which
20
- # receives arbitrary length datagrams which may-or-may-not contain the token
21
- # by which entities are delimited.
22
- #
23
- # Commonly used to parse lines out of incoming data:
24
- #
25
- # module LineBufferedConnection
26
- # def receive_data(data)
27
- # (@buffer ||= BufferedTokenizer.new).extract(data).each do |line|
28
- # receive_line(line)
29
- # end
30
- # end
31
- # end
32
-
33
- module FileWatch; class BufferedTokenizer
34
- # New BufferedTokenizers will operate on lines delimited by "\n" by default
35
- # or allow you to specify any delimiter token you so choose, which will then
36
- # be used by String#split to tokenize the input data
37
- def initialize(delimiter = "\n", size_limit = nil)
38
- # Store the specified delimiter
39
- @delimiter = delimiter
40
-
41
- # Store the specified size limitation
42
- @size_limit = size_limit
43
-
44
- # The input buffer is stored as an array. This is by far the most efficient
45
- # approach given language constraints (in C a linked list would be a more
46
- # appropriate data structure). Segments of input data are stored in a list
47
- # which is only joined when a token is reached, substantially reducing the
48
- # number of objects required for the operation.
49
- @input = []
50
-
51
- # Size of the input buffer
52
- @input_size = 0
53
- end
54
-
55
- # Extract takes an arbitrary string of input data and returns an array of
56
- # tokenized entities, provided there were any available to extract. This
57
- # makes for easy processing of datagrams using a pattern like:
58
- #
59
- # tokenizer.extract(data).map { |entity| Decode(entity) }.each do ...
60
- def extract(data)
61
- # Extract token-delimited entities from the input string with the split command.
62
- # There's a bit of craftiness here with the -1 parameter. Normally split would
63
- # behave no differently regardless of if the token lies at the very end of the
64
- # input buffer or not (i.e. a literal edge case) Specifying -1 forces split to
65
- # return "" in this case, meaning that the last entry in the list represents a
66
- # new segment of data where the token has not been encountered
67
- entities = data.split @delimiter, -1
68
-
69
- # Check to see if the buffer has exceeded capacity, if we're imposing a limit
70
- if @size_limit
71
- raise 'input buffer full' if @input_size + entities.first.size > @size_limit
72
- @input_size += entities.first.size
73
- end
74
-
75
- # Move the first entry in the resulting array into the input buffer. It represents
76
- # the last segment of a token-delimited entity unless it's the only entry in the list.
77
- @input << entities.shift
78
-
79
- # If the resulting array from the split is empty, the token was not encountered
80
- # (not even at the end of the buffer). Since we've encountered no token-delimited
81
- # entities this go-around, return an empty array.
82
- return [] if entities.empty?
83
-
84
- # At this point, we've hit a token, or potentially multiple tokens. Now we can bring
85
- # together all the data we've buffered from earlier calls without hitting a token,
86
- # and add it to our list of discovered entities.
87
- entities.unshift @input.join
88
-
89
- =begin
90
- # Note added by FC, 10Jul07. This paragraph contains a regression. It breaks
91
- # empty tokens. Think of the empty line that delimits an HTTP header. It will have
92
- # two "\n" delimiters in a row, and this code mishandles the resulting empty token.
93
- # It someone figures out how to fix the problem, we can re-enable this code branch.
94
- # Multi-character token support.
95
- # Split any tokens that were incomplete on the last iteration buf complete now.
96
- entities.map! do |e|
97
- e.split @delimiter, -1
98
- end
99
- # Flatten the resulting array. This has the side effect of removing the empty
100
- # entry at the end that was produced by passing -1 to split. Add it again if
101
- # necessary.
102
- if (entities[-1] == [])
103
- entities.flatten! << []
104
- else
105
- entities.flatten!
106
- end
107
- =end
108
-
109
- # Now that we've hit a token, joined the input buffer and added it to the entities
110
- # list, we can go ahead and clear the input buffer. All of the segments that were
111
- # stored before the join can now be garbage collected.
112
- @input.clear
113
-
114
- # The last entity in the list is not token delimited, however, thanks to the -1
115
- # passed to split. It represents the beginning of a new list of as-yet-untokenized
116
- # data, so we add it to the start of the list.
117
- @input << entities.pop
118
-
119
- # Set the new input buffer size, provided we're keeping track
120
- @input_size = @input.first.size if @size_limit
121
-
122
- # Now we're left with the list of extracted token-delimited entities we wanted
123
- # in the first place. Hooray!
124
- entities
125
- end
126
-
127
- # Flush the contents of the input buffer, i.e. return the input buffer even though
128
- # a token has not yet been encountered
129
- def flush
130
- buffer = @input.join
131
- @input.clear
132
- buffer
133
- end
134
-
135
- # Is the buffer empty?
136
- def empty?
137
- @input.empty?
138
- end
139
- end; end
1
+ # Keeping this file for backwards compatibility with plugins that include it directly.
@@ -1,5 +1,4 @@
1
1
  # encoding: utf-8
2
- require "logstash/namespace"
3
2
 
4
3
  module LogStash; module Util; module ByteValue
5
4
  module_function
@@ -23,7 +22,7 @@ module LogStash; module Util; module ByteValue
23
22
 
24
23
  def multiplier(text)
25
24
  case text
26
- when /(?:k|kb)$/
25
+ when /(?:k|kb)$/
27
26
  KB
28
27
  when /(?:m|mb)$/
29
28
  MB
@@ -35,7 +34,7 @@ module LogStash; module Util; module ByteValue
35
34
  PB
36
35
  when /(?:b)$/
37
36
  B
38
- else
37
+ else
39
38
  raise ArgumentError, "Unknown bytes value '#{text}'"
40
39
  end
41
40
  end
@@ -1,5 +1,4 @@
1
1
  # encoding: utf-8
2
- require "logstash/namespace"
3
2
  require "logstash/util"
4
3
 
5
4
  class LogStash::Util::Charset
@@ -1,5 +1,4 @@
1
1
  # encoding: utf-8
2
- require "logstash/namespace"
3
2
  require "logstash/util/password"
4
3
 
5
4
  module LogStash module Util class CloudSettingAuth
@@ -1,5 +1,4 @@
1
1
  # encoding: utf-8
2
- require "logstash/namespace"
3
2
  require "base64"
4
3
 
5
4
  module LogStash module Util class CloudSettingId
@@ -8,9 +7,12 @@ module LogStash module Util class CloudSettingId
8
7
  Base64.urlsafe_encode64(args.join("$"))
9
8
  end
10
9
  DOT_SEPARATOR = "."
11
- CLOUD_PORT = ":443"
10
+ CLOUD_PORT = "443"
12
11
 
13
- attr_reader :original, :decoded, :label, :elasticsearch_host, :elasticsearch_scheme, :kibana_host, :kibana_scheme
12
+ attr_reader :original, :decoded, :label
13
+ attr_reader :elasticsearch_host, :elasticsearch_scheme, :elasticsearch_port
14
+ attr_reader :kibana_host, :kibana_scheme, :kibana_port
15
+ attr_reader :other_identifiers
14
16
 
15
17
  # The constructor is expecting a 'cloud.id', a string in 2 variants.
16
18
  # 1 part example: 'dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRub3RhcmVhbCRpZGVudGlmaWVy'
@@ -40,8 +42,8 @@ module LogStash module Util class CloudSettingId
40
42
 
41
43
  @decoded = @decoded.encode(Encoding::UTF_8, :invalid => :replace, :undef => :replace)
42
44
 
43
- unless @decoded.count("$") == 2
44
- raise ArgumentError.new("Cloud Id does not decode. You may need to enable Kibana in the Cloud UI. Received: \"#{@decoded}\".")
45
+ if @decoded.count("$") < 2
46
+ raise ArgumentError.new("Cloud Id, after decoding, is invalid. Format: '<segment1>$<segment2>$<segment3>'. Received: \"#{@decoded}\".")
45
47
  end
46
48
 
47
49
  segments = @decoded.split("$")
@@ -49,20 +51,30 @@ module LogStash module Util class CloudSettingId
49
51
  raise ArgumentError.new("Cloud Id, after decoding, is invalid. Format: '<segment1>$<segment2>$<segment3>'. Received: \"#{@decoded}\".")
50
52
  end
51
53
  cloud_base = segments.shift
52
- cloud_host = "#{DOT_SEPARATOR}#{cloud_base}#{CLOUD_PORT}"
54
+ cloud_host = "#{DOT_SEPARATOR}#{cloud_base}"
55
+ cloud_host, cloud_port = cloud_host.split(":")
56
+ cloud_port ||= CLOUD_PORT
57
+
58
+ @elasticsearch_host, @kibana_host, *@other_identifiers = segments
59
+ @elasticsearch_host, @elasticsearch_port = @elasticsearch_host.split(":")
60
+ @kibana_host, @kibana_port = @kibana_host.split(":")
61
+ @elasticsearch_port ||= cloud_port
62
+ @kibana_port ||= cloud_port
63
+ @other_identifiers ||= []
53
64
 
54
- @elasticsearch_host, @kibana_host = segments
55
65
  if @elasticsearch_host == "undefined"
56
66
  raise ArgumentError.new("Cloud Id, after decoding, elasticsearch segment is 'undefined', literally.")
57
67
  end
58
68
  @elasticsearch_scheme = "https"
59
69
  @elasticsearch_host.concat(cloud_host)
70
+ @elasticsearch_host.concat(":#{@elasticsearch_port}")
60
71
 
61
72
  if @kibana_host == "undefined"
62
73
  raise ArgumentError.new("Cloud Id, after decoding, the kibana segment is 'undefined', literally. You may need to enable Kibana in the Cloud UI.")
63
74
  end
64
75
  @kibana_scheme = "https"
65
76
  @kibana_host.concat(cloud_host)
77
+ @kibana_host.concat(":#{@kibana_port}")
66
78
  end
67
79
 
68
80
  def to_s
@@ -72,4 +84,4 @@ module LogStash module Util class CloudSettingId
72
84
  def inspect
73
85
  to_s
74
86
  end
75
- end end end
87
+ end end end
@@ -1,61 +1,2 @@
1
- require 'logstash/environment'
2
-
3
- module LogStash; module Util
4
- class PluginDeadLetterQueueWriter
5
-
6
- attr_reader :plugin_id, :plugin_type, :inner_writer
7
-
8
- def initialize(inner_writer, plugin_id, plugin_type)
9
- @plugin_id = plugin_id
10
- @plugin_type = plugin_type
11
- @inner_writer = inner_writer
12
- end
13
-
14
- def write(logstash_event, reason)
15
- if @inner_writer && @inner_writer.is_open
16
- @inner_writer.writeEntry(logstash_event.to_java, @plugin_type, @plugin_id, reason)
17
- end
18
- end
19
-
20
- def close
21
- if @inner_writer && @inner_writer.is_open
22
- @inner_writer.close
23
- end
24
- end
25
- end
26
-
27
- class DummyDeadLetterQueueWriter
28
- # class uses to represent a writer when dead_letter_queue is disabled
29
- def initialize
30
- end
31
-
32
- def write(logstash_event, reason)
33
- # noop
34
- end
35
-
36
- def is_open
37
- false
38
- end
39
-
40
- def close
41
- # noop
42
- end
43
- end
44
-
45
- class DeadLetterQueueFactory
46
- java_import org.logstash.common.DeadLetterQueueFactory
47
-
48
- def self.get(pipeline_id)
49
- if LogStash::SETTINGS.get("dead_letter_queue.enable")
50
- return DeadLetterQueueWriter.new(
51
- DeadLetterQueueFactory.getWriter(pipeline_id, LogStash::SETTINGS.get("path.dead_letter_queue"), LogStash::SETTINGS.get('dead_letter_queue.max_bytes')))
52
- else
53
- return DeadLetterQueueWriter.new(nil)
54
- end
55
- end
56
-
57
- def self.close(pipeline_id)
58
- DeadLetterQueueFactory.close(pipeline_id)
59
- end
60
- end
61
- end end
1
+ # The contents of this file have been ported to Java. It is included for for compatibility
2
+ # with plugins that directly include it.
@@ -1,5 +1,4 @@
1
1
  # encoding: utf-8
2
- require "logstash/namespace"
3
2
  require "logstash/util"
4
3
 
5
4
  module LogStash::Util
@@ -1,31 +1 @@
1
- # encoding: utf-8
2
- require "logstash/logging/logger"
3
- require "logstash/namespace"
4
-
5
- module LogStash module Util
6
- module Loggable
7
- def self.included(klass)
8
-
9
- def klass.log4j_name
10
- ruby_name = self.name || self.class.name || self.class.to_s
11
- ruby_name.gsub('::', '.').downcase
12
- end
13
-
14
- def klass.logger
15
- @logger ||= LogStash::Logging::Logger.new(log4j_name)
16
- end
17
-
18
- def klass.slow_logger(warn_threshold, info_threshold, debug_threshold, trace_threshold)
19
- @slow_logger ||= LogStash::Logging::SlowLogger.new(log4j_name, warn_threshold, info_threshold, debug_threshold, trace_threshold)
20
- end
21
-
22
- def logger
23
- self.class.logger
24
- end
25
-
26
- def slow_logger(warn_threshold, info_threshold, debug_threshold, trace_threshold)
27
- self.class.slow_logger(warn_threshold, info_threshold, debug_threshold, trace_threshold)
28
- end
29
- end
30
- end
31
- end; end
1
+ # Keeping this file for backwards compatibility with plugins that include it directly.
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require "logstash/namespace"
2
+ require "forwardable"
3
3
  require "logstash/util/password"
4
4
 
5
5
  module LogStash module Util class ModulesSettingArray
@@ -25,4 +25,4 @@ module LogStash module Util class ModulesSettingArray
25
25
  def __class__
26
26
  LogStash::Util::ModulesSettingArray
27
27
  end
28
- end end end
28
+ end end end
@@ -1,5 +1,4 @@
1
1
  # encoding: utf-8
2
- require "logstash/namespace"
3
2
 
4
3
  # This class exists to quietly wrap a password string so that, when printed or
5
4
  # logged, you don't accidentally print the password itself.
@@ -1,5 +1,4 @@
1
1
  # encoding: utf-8
2
- require 'logstash/errors'
3
2
  require 'rubygems/version'
4
3
  require 'forwardable'
5
4
 
@@ -1,5 +1,4 @@
1
1
  # encoding: utf-8
2
- require "logstash/namespace"
3
2
  require "logstash/util"
4
3
  require "forwardable"
5
4
 
@@ -8,14 +7,14 @@ require "forwardable"
8
7
  class LogStash::Util::SafeURI
9
8
  PASS_PLACEHOLDER = "xxxxxx".freeze
10
9
  HOSTNAME_PORT_REGEX=/\A(?<hostname>([A-Za-z0-9\.\-]+)|\[[0-9A-Fa-f\:]+\])(:(?<port>\d+))?\Z/
11
-
10
+
12
11
  extend Forwardable
13
-
14
-
12
+
13
+
15
14
  attr_reader :uri
16
15
 
17
16
  public
18
- def initialize(arg)
17
+ def initialize(arg)
19
18
  @uri = case arg
20
19
  when String
21
20
  arg = "//#{arg}" if HOSTNAME_PORT_REGEX.match(arg)
@@ -39,7 +38,7 @@ class LogStash::Util::SafeURI
39
38
 
40
39
  def sanitized
41
40
  return uri unless password # nothing to sanitize here!
42
-
41
+
43
42
  user_info = user ? "#{user}:#{PASS_PLACEHOLDER}" : nil
44
43
 
45
44
  make_uri(scheme, user_info, host, port, path, query, fragment)
@@ -64,7 +63,7 @@ class LogStash::Util::SafeURI
64
63
  new_query = query
65
64
  new_fragment = fragment
66
65
 
67
- case field
66
+ case field
68
67
  when :scheme
69
68
  new_scheme = value
70
69
  when :user
@@ -124,7 +123,7 @@ class LogStash::Util::SafeURI
124
123
  # In java this is an int
125
124
  uri.port < 1 ? nil : uri.port
126
125
  end
127
-
126
+
128
127
  def port=(new_port)
129
128
  update(:port, new_port)
130
129
  end