logstash-core 5.6.16-java → 6.0.0.alpha1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/gemspec_jars.rb +4 -7
  3. data/lib/logstash-core/logstash-core.jar +0 -0
  4. data/lib/logstash-core/version.rb +4 -8
  5. data/lib/logstash-core_jars.rb +12 -26
  6. data/lib/logstash/agent.rb +261 -246
  7. data/lib/logstash/api/commands/default_metadata.rb +1 -1
  8. data/lib/logstash/api/commands/hot_threads_reporter.rb +5 -11
  9. data/lib/logstash/api/commands/node.rb +3 -2
  10. data/lib/logstash/api/commands/stats.rb +3 -2
  11. data/lib/logstash/bootstrap_check/bad_java.rb +16 -0
  12. data/lib/logstash/bootstrap_check/bad_ruby.rb +12 -0
  13. data/lib/logstash/bootstrap_check/default_config.rb +17 -0
  14. data/lib/logstash/compiler.rb +38 -0
  15. data/lib/logstash/compiler/lscl.rb +566 -0
  16. data/lib/logstash/compiler/lscl/lscl_grammar.rb +3503 -0
  17. data/lib/logstash/compiler/treetop_monkeypatches.rb +92 -0
  18. data/lib/logstash/config/config_ast.rb +4 -82
  19. data/lib/logstash/config/mixin.rb +73 -41
  20. data/lib/logstash/config/pipeline_config.rb +48 -0
  21. data/lib/logstash/config/source/base.rb +16 -0
  22. data/lib/logstash/config/source/local.rb +215 -0
  23. data/lib/logstash/config/source_loader.rb +125 -0
  24. data/lib/logstash/converge_result.rb +103 -0
  25. data/lib/logstash/environment.rb +6 -19
  26. data/lib/logstash/errors.rb +2 -0
  27. data/lib/logstash/execution_context.rb +4 -7
  28. data/lib/logstash/filter_delegator.rb +6 -9
  29. data/lib/logstash/inputs/base.rb +0 -2
  30. data/lib/logstash/instrument/collector.rb +5 -7
  31. data/lib/logstash/instrument/metric_store.rb +12 -12
  32. data/lib/logstash/instrument/metric_type/mean.rb +0 -5
  33. data/lib/logstash/instrument/namespaced_metric.rb +0 -4
  34. data/lib/logstash/instrument/namespaced_null_metric.rb +0 -4
  35. data/lib/logstash/instrument/null_metric.rb +0 -10
  36. data/lib/logstash/instrument/periodic_poller/cgroup.rb +85 -168
  37. data/lib/logstash/instrument/periodic_poller/jvm.rb +5 -5
  38. data/lib/logstash/instrument/periodic_poller/pq.rb +3 -7
  39. data/lib/logstash/instrument/periodic_pollers.rb +1 -3
  40. data/lib/logstash/instrument/wrapped_write_client.rb +24 -33
  41. data/lib/logstash/logging/logger.rb +15 -47
  42. data/lib/logstash/namespace.rb +0 -1
  43. data/lib/logstash/output_delegator.rb +5 -7
  44. data/lib/logstash/outputs/base.rb +0 -2
  45. data/lib/logstash/pipeline.rb +159 -87
  46. data/lib/logstash/pipeline_action.rb +13 -0
  47. data/lib/logstash/pipeline_action/base.rb +29 -0
  48. data/lib/logstash/pipeline_action/create.rb +47 -0
  49. data/lib/logstash/pipeline_action/reload.rb +48 -0
  50. data/lib/logstash/pipeline_action/stop.rb +23 -0
  51. data/lib/logstash/plugin.rb +0 -1
  52. data/lib/logstash/plugins/hooks_registry.rb +6 -0
  53. data/lib/logstash/plugins/registry.rb +0 -1
  54. data/lib/logstash/program.rb +14 -0
  55. data/lib/logstash/queue_factory.rb +5 -1
  56. data/lib/logstash/runner.rb +58 -80
  57. data/lib/logstash/settings.rb +3 -27
  58. data/lib/logstash/state_resolver.rb +41 -0
  59. data/lib/logstash/util/java_version.rb +6 -0
  60. data/lib/logstash/util/safe_uri.rb +12 -148
  61. data/lib/logstash/util/thread_dump.rb +4 -7
  62. data/lib/logstash/util/wrapped_acked_queue.rb +36 -39
  63. data/lib/logstash/util/wrapped_synchronous_queue.rb +29 -39
  64. data/lib/logstash/version.rb +10 -8
  65. data/locales/en.yml +3 -54
  66. data/logstash-core.gemspec +8 -35
  67. data/spec/{logstash/api/modules → api/lib/api}/logging_spec.rb +10 -1
  68. data/spec/{logstash/api/modules → api/lib/api}/node_plugins_spec.rb +2 -1
  69. data/spec/{logstash/api/modules → api/lib/api}/node_spec.rb +3 -3
  70. data/spec/{logstash/api/modules → api/lib/api}/node_stats_spec.rb +3 -7
  71. data/spec/{logstash/api/modules → api/lib/api}/plugins_spec.rb +3 -4
  72. data/spec/{logstash/api/modules → api/lib/api}/root_spec.rb +2 -2
  73. data/spec/api/lib/api/support/resource_dsl_methods.rb +87 -0
  74. data/spec/{logstash/api/commands/stats_spec.rb → api/lib/commands/stats.rb} +2 -7
  75. data/spec/{logstash/api → api/lib}/errors_spec.rb +1 -1
  76. data/spec/{logstash/api → api/lib}/rack_app_spec.rb +0 -0
  77. data/spec/api/spec_helper.rb +106 -0
  78. data/spec/logstash/agent/converge_spec.rb +286 -0
  79. data/spec/logstash/agent/metrics_spec.rb +244 -0
  80. data/spec/logstash/agent_spec.rb +213 -225
  81. data/spec/logstash/compiler/compiler_spec.rb +584 -0
  82. data/spec/logstash/config/config_ast_spec.rb +8 -47
  83. data/spec/logstash/config/mixin_spec.rb +2 -42
  84. data/spec/logstash/config/pipeline_config_spec.rb +75 -0
  85. data/spec/logstash/config/source/local_spec.rb +395 -0
  86. data/spec/logstash/config/source_loader_spec.rb +122 -0
  87. data/spec/logstash/converge_result_spec.rb +179 -0
  88. data/spec/logstash/event_spec.rb +0 -66
  89. data/spec/logstash/execution_context_spec.rb +8 -12
  90. data/spec/logstash/filter_delegator_spec.rb +12 -24
  91. data/spec/logstash/inputs/base_spec.rb +7 -5
  92. data/spec/logstash/instrument/periodic_poller/cgroup_spec.rb +92 -225
  93. data/spec/logstash/instrument/periodic_poller/jvm_spec.rb +1 -1
  94. data/spec/logstash/instrument/periodic_poller/os_spec.rb +32 -29
  95. data/spec/logstash/instrument/wrapped_write_client_spec.rb +33 -33
  96. data/spec/logstash/legacy_ruby_event_spec.rb +13 -4
  97. data/spec/logstash/output_delegator_spec.rb +11 -20
  98. data/spec/logstash/outputs/base_spec.rb +7 -5
  99. data/spec/logstash/pipeline_action/create_spec.rb +83 -0
  100. data/spec/logstash/pipeline_action/reload_spec.rb +83 -0
  101. data/spec/logstash/pipeline_action/stop_spec.rb +37 -0
  102. data/spec/logstash/pipeline_pq_file_spec.rb +1 -1
  103. data/spec/logstash/pipeline_spec.rb +81 -137
  104. data/spec/logstash/plugin_spec.rb +2 -1
  105. data/spec/logstash/plugins/hooks_registry_spec.rb +6 -0
  106. data/spec/logstash/queue_factory_spec.rb +13 -1
  107. data/spec/logstash/runner_spec.rb +29 -140
  108. data/spec/logstash/settings/writable_directory_spec.rb +10 -13
  109. data/spec/logstash/settings_spec.rb +0 -91
  110. data/spec/logstash/state_resolver_spec.rb +156 -0
  111. data/spec/logstash/timestamp_spec.rb +2 -6
  112. data/spec/logstash/util/java_version_spec.rb +22 -0
  113. data/spec/logstash/util/safe_uri_spec.rb +0 -56
  114. data/spec/logstash/util/wrapped_synchronous_queue_spec.rb +22 -0
  115. data/spec/support/helpers.rb +9 -11
  116. data/spec/support/matchers.rb +96 -6
  117. data/spec/support/mocks_classes.rb +80 -0
  118. data/spec/support/shared_contexts.rb +2 -27
  119. metadata +100 -149
  120. data/lib/logstash/config/loader.rb +0 -107
  121. data/lib/logstash/config/modules_common.rb +0 -103
  122. data/lib/logstash/config/source/modules.rb +0 -55
  123. data/lib/logstash/config/string_escape.rb +0 -27
  124. data/lib/logstash/dependency_report.rb +0 -131
  125. data/lib/logstash/dependency_report_runner.rb +0 -17
  126. data/lib/logstash/elasticsearch_client.rb +0 -142
  127. data/lib/logstash/instrument/global_metrics.rb +0 -13
  128. data/lib/logstash/instrument/periodic_poller/dlq.rb +0 -24
  129. data/lib/logstash/modules/cli_parser.rb +0 -74
  130. data/lib/logstash/modules/elasticsearch_config.rb +0 -22
  131. data/lib/logstash/modules/elasticsearch_importer.rb +0 -37
  132. data/lib/logstash/modules/elasticsearch_resource.rb +0 -10
  133. data/lib/logstash/modules/file_reader.rb +0 -36
  134. data/lib/logstash/modules/kibana_base.rb +0 -24
  135. data/lib/logstash/modules/kibana_client.rb +0 -124
  136. data/lib/logstash/modules/kibana_config.rb +0 -105
  137. data/lib/logstash/modules/kibana_dashboards.rb +0 -36
  138. data/lib/logstash/modules/kibana_importer.rb +0 -17
  139. data/lib/logstash/modules/kibana_resource.rb +0 -10
  140. data/lib/logstash/modules/kibana_settings.rb +0 -40
  141. data/lib/logstash/modules/logstash_config.rb +0 -120
  142. data/lib/logstash/modules/resource_base.rb +0 -38
  143. data/lib/logstash/modules/scaffold.rb +0 -52
  144. data/lib/logstash/modules/settings_merger.rb +0 -23
  145. data/lib/logstash/modules/util.rb +0 -17
  146. data/lib/logstash/util/dead_letter_queue_manager.rb +0 -61
  147. data/lib/logstash/util/environment_variables.rb +0 -43
  148. data/spec/logstash/config/loader_spec.rb +0 -38
  149. data/spec/logstash/config/string_escape_spec.rb +0 -24
  150. data/spec/logstash/instrument/periodic_poller/dlq_spec.rb +0 -17
  151. data/spec/logstash/modules/logstash_config_spec.rb +0 -56
  152. data/spec/logstash/modules/scaffold_spec.rb +0 -234
  153. data/spec/logstash/pipeline_dlq_commit_spec.rb +0 -109
  154. data/spec/logstash/settings/splittable_string_array_spec.rb +0 -51
  155. data/spec/logstash/util/wrapped_acked_queue_spec.rb +0 -49
  156. data/versions-gem-copy.yml +0 -12
@@ -18,6 +18,21 @@ module LogStash; module Util
18
18
  end
19
19
  alias_method(:<<, :push)
20
20
 
21
+ # Offer an object to the queue, wait for the specified amount of time.
22
+ # If adding to the queue was successful it wil return true, false otherwise.
23
+ #
24
+ # @param [Object] Object to add to the queue
25
+ # @param [Integer] Time in milliseconds to wait before giving up
26
+ # @return [Boolean] True if adding was successful if not it return false
27
+ def offer(obj, timeout_ms)
28
+ @queue.offer(obj, timeout_ms, TimeUnit::MILLISECONDS)
29
+ end
30
+
31
+ # Blocking
32
+ def take
33
+ @queue.take
34
+ end
35
+
21
36
  # Block for X millis
22
37
  def poll(millis)
23
38
  @queue.poll(millis, TimeUnit::MILLISECONDS)
@@ -68,17 +83,11 @@ module LogStash; module Util
68
83
 
69
84
  def set_events_metric(metric)
70
85
  @event_metric = metric
71
- @event_metric_out = @event_metric.counter(:out)
72
- @event_metric_filtered = @event_metric.counter(:filtered)
73
- @event_metric_time = @event_metric.counter(:duration_in_millis)
74
86
  define_initial_metrics_values(@event_metric)
75
87
  end
76
88
 
77
89
  def set_pipeline_metric(metric)
78
90
  @pipeline_metric = metric
79
- @pipeline_metric_out = @pipeline_metric.counter(:out)
80
- @pipeline_metric_filtered = @pipeline_metric.counter(:filtered)
81
- @pipeline_metric_time = @pipeline_metric.counter(:duration_in_millis)
82
91
  define_initial_metrics_values(@pipeline_metric)
83
92
  end
84
93
 
@@ -89,11 +98,8 @@ module LogStash; module Util
89
98
  end
90
99
 
91
100
  def inflight_batches
92
- @mutex.lock
93
- begin
101
+ @mutex.synchronize do
94
102
  yield(@inflight_batches)
95
- ensure
96
- @mutex.unlock
97
103
  end
98
104
  end
99
105
 
@@ -109,24 +115,16 @@ module LogStash; module Util
109
115
 
110
116
  def read_batch
111
117
  batch = new_batch
112
- @mutex.lock
113
- begin
114
- batch.read_next
115
- ensure
116
- @mutex.unlock
117
- end
118
+ @mutex.synchronize { batch.read_next }
118
119
  start_metrics(batch)
119
120
  batch
120
121
  end
121
122
 
122
123
  def start_metrics(batch)
123
- @mutex.lock
124
- # there seems to be concurrency issues with metrics, keep it in the mutex
125
- begin
124
+ @mutex.synchronize do
125
+ # there seems to be concurrency issues with metrics, keep it in the mutex
126
126
  set_current_thread_inflight_batch(batch)
127
127
  start_clock
128
- ensure
129
- @mutex.unlock
130
128
  end
131
129
  end
132
130
 
@@ -135,18 +133,18 @@ module LogStash; module Util
135
133
  end
136
134
 
137
135
  def close_batch(batch)
138
- @mutex.lock
139
- begin
136
+ @mutex.synchronize do
140
137
  # there seems to be concurrency issues with metrics, keep it in the mutex
141
138
  @inflight_batches.delete(Thread.current)
142
139
  stop_clock(batch)
143
- ensure
144
- @mutex.unlock
145
140
  end
146
141
  end
147
142
 
148
143
  def start_clock
149
- @inflight_clocks[Thread.current] = java.lang.System.current_time_millis
144
+ @inflight_clocks[Thread.current] = [
145
+ @event_metric.time(:duration_in_millis),
146
+ @pipeline_metric.time(:duration_in_millis)
147
+ ]
150
148
  end
151
149
 
152
150
  def stop_clock(batch)
@@ -155,22 +153,20 @@ module LogStash; module Util
155
153
  # only stop (which also records) the metrics if the batch is non-empty.
156
154
  # start_clock is now called at empty batch creation and an empty batch could
157
155
  # stay empty all the way down to the close_batch call.
158
- time_taken = java.lang.System.current_time_millis - @inflight_clocks[Thread.current]
159
- @event_metric_time.increment(time_taken)
160
- @pipeline_metric_time.increment(time_taken)
156
+ @inflight_clocks[Thread.current].each(&:stop)
161
157
  end
162
158
  @inflight_clocks.delete(Thread.current)
163
159
  end
164
160
  end
165
161
 
166
162
  def add_filtered_metrics(batch)
167
- @event_metric_filtered.increment(batch.filtered_size)
168
- @pipeline_metric_filtered.increment(batch.filtered_size)
163
+ @event_metric.increment(:filtered, batch.filtered_size)
164
+ @pipeline_metric.increment(:filtered, batch.filtered_size)
169
165
  end
170
166
 
171
167
  def add_output_metrics(batch)
172
- @event_metric_out.increment(batch.filtered_size)
173
- @pipeline_metric_out.increment(batch.filtered_size)
168
+ @event_metric.increment(:out, batch.filtered_size)
169
+ @pipeline_metric.increment(:out, batch.filtered_size)
174
170
  end
175
171
  end
176
172
 
@@ -218,12 +214,6 @@ module LogStash; module Util
218
214
  # @cancelled[event] = true
219
215
  end
220
216
 
221
- def to_a
222
- events = []
223
- each {|e| events << e}
224
- events
225
- end
226
-
227
217
  def each(&blk)
228
218
  # take care not to cause @originals or @generated to change during iteration
229
219
  @iterating = true
@@ -2,11 +2,13 @@
2
2
 
3
3
  # The version of the logstash package (not the logstash-core gem version).
4
4
  #
5
- # sourced from a copy of the master versions.yml file, see logstash-core/logstash-core.gemspec
6
- if !defined?(ALL_VERSIONS)
7
- require 'yaml'
8
- ALL_VERSIONS = YAML.load_file(File.expand_path("../../versions-gem-copy.yml", File.dirname(__FILE__)))
9
- end
10
- if !defined?(LOGSTASH_VERSION)
11
- LOGSTASH_VERSION = ALL_VERSIONS.fetch("logstash")
12
- end
5
+ # Note to authors: this should not include dashes because 'gem' barfs if
6
+ # you include a dash in the version string.
7
+
8
+ # TODO: (colin) the logstash-core gem uses it's own version number in logstash-core/lib/logstash-core/version.rb
9
+ # there are some dependencies in logstash-core on the LOGSTASH_VERSION constant this is why
10
+ # the logstash version is currently defined here in logstash-core/lib/logstash/version.rb but
11
+ # eventually this file should be in the root logstash lib fir and dependencies in logstash-core should be
12
+ # fixed.
13
+
14
+ LOGSTASH_VERSION = "6.0.0-alpha1"
@@ -16,10 +16,12 @@ en:
16
16
  pipeline:
17
17
  worker-error: |-
18
18
  A plugin had an unrecoverable error. Will restart this plugin.
19
+ Pipeline_id:%{pipeline_id}
19
20
  Plugin: %{plugin}
20
21
  Error: %{error}
21
22
  worker-error-debug: |-
22
23
  A plugin had an unrecoverable error. Will restart this plugin.
24
+ Pipeline_id:%{pipeline_id}
23
25
  Plugin: %{plugin}
24
26
  Error: %{error}
25
27
  Exception: %{exception}
@@ -79,37 +81,14 @@ en:
79
81
  ::: {%{hostname}}
80
82
  Hot threads at %{time}, busiestThreads=%{top_count}:
81
83
  thread_title: |-
82
- %{percent_of_cpu_time} % of cpu usage, state: %{thread_state}, thread name: '%{thread_name}', thread id: %{thread_id}
84
+ %{percent_of_cpu_time} % of cpu usage, state: %{thread_state}, thread name: '%{thread_name}'
83
85
  logging:
84
86
  unrecognized_option: |-
85
87
  unrecognized option [%{option}]
86
- modules:
87
- configuration:
88
- parse-failed: |-
89
- Failed to parse the module configuration: [%{error}]
90
- modules-must-be-unique: >-
91
- Only a single instance of any module can be run at a time. Duplicate
92
- modules: %{duplicate_modules}
93
- modules-invalid-name: >-
94
- Invalid module name: %{module_name}
95
- modules-variables-malformed: >-
96
- Failed to parse module variable %{rawvar}. Must be in -M
97
- "MODULE_NAME.KEY.SUBKEY=VALUE" format
98
- modules-unavailable: >-
99
- The modules specified are not available yet.
100
- Specified modules: %{specified_modules}
101
- Available modules: %{available_modules}
102
- elasticsearch_connection_failed: >-
103
- Failed to import module configurations to Elasticsearch and/or Kibana.
104
- Module: %{module_name} has Elasticsearch hosts: %{elasticsearch_hosts} and Kibana hosts: %{kibana_hosts}
105
- modules-too-many-specified: >-
106
- Too many modules specified. Maximum allowed: %{max}, specified: %{specified_modules}
107
-
108
88
  runner:
109
89
  short-help: |-
110
90
  usage:
111
91
  bin/logstash -f CONFIG_PATH [-t] [-r] [] [-w COUNT] [-l LOG]
112
- bin/logstash --modules MODULE_NAME [-M "MODULE_NAME.var.PLUGIN_TYPE.PLUGIN_NAME.VARIABLE_NAME=VALUE"] [-t] [-w COUNT] [-l LOG]
113
92
  bin/logstash -e CONFIG_STR [-t] [--log.level fatal|error|warn|info|debug|trace] [-w COUNT] [-l LOG]
114
93
  bin/logstash -i SHELL [--log.level fatal|error|warn|info|debug|trace]
115
94
  bin/logstash -V [--log.level fatal|error|warn|info|debug|trace]
@@ -119,14 +98,6 @@ en:
119
98
  missing-configuration: >-
120
99
  No configuration file was specified. Perhaps you forgot to provide
121
100
  the '-f yourlogstash.conf' flag?
122
- config-module-exclusive: >-
123
- Settings 'path.config' (-f) or 'config.string' (-e) can't be used in conjunction with
124
- (--modules) or the "modules:" block in the logstash.yml file.
125
- reload-with-modules: >-
126
- Configuration reloading can't be used with command-line or logstash.yml specified modules.
127
- cli-module-override: >-
128
- Both command-line and logstash.yml modules configurations detected.
129
- Using command-line module configuration to override logstash.yml module configuration.
130
101
  reload-without-config-path: >-
131
102
  Configuration reloading also requires passing a configuration path with '-f yourlogstash.conf'
132
103
  locked-data-path: >-
@@ -212,28 +183,6 @@ en:
212
183
  "%{default_output}"
213
184
  If you wish to use both defaults, please use
214
185
  the empty string for the '-e' flag.
215
- modules: |+
216
- Load Logstash modules.
217
- Modules can be defined using multiple instances
218
- '--modules module1 --modules module2',
219
- or comma-separated syntax
220
- '--modules=module1,module2'
221
- Cannot be used in conjunction with '-e' or '-f'
222
- Use of '--modules' will override modules declared
223
- in the 'logstash.yml' file.
224
- modules_variable: |+
225
- Load variables for module template.
226
- Multiple instances of '-M' or
227
- '--modules.variable' are supported.
228
- Ignored if '--modules' flag is not used.
229
- Should be in the format of
230
- '-M "MODULE_NAME.var.PLUGIN_TYPE.PLUGIN_NAME.VARIABLE_NAME=VALUE"'
231
- as in
232
- '-M "example.var.filter.mutate.fieldname=fieldvalue"'
233
- modules_setup: |+
234
- Load index template into Elasticsearch, and saved searches,
235
- index-pattern, visualizations, and dashboards into Kibana when
236
- running modules.
237
186
  configtest: |+
238
187
  Check configuration for valid syntax and then exit.
239
188
  http_host: Web API binding host
@@ -1,25 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
-
5
- project_versions_yaml_path = File.expand_path("../versions.yml", File.dirname(__FILE__))
6
- if File.exist?(project_versions_yaml_path)
7
- # we need to copy the project level versions.yml into the gem root
8
- # to be able to package it into the gems file structure
9
- # as the require 'logstash-core/version' loads the yaml file from within the gem root.
10
- #
11
- # we ignore the copy in git and we overwrite an existing file
12
- # each time we build the logstash-core gem
13
- original_lines = IO.readlines(project_versions_yaml_path)
14
- original_lines << ""
15
- original_lines << "# This is a copy the project level versions.yml into this gem's root and it is created when the gemspec is evaluated."
16
- gem_versions_yaml_path = File.expand_path("./versions-gem-copy.yml", File.dirname(__FILE__))
17
- File.open(gem_versions_yaml_path, 'w') do |new_file|
18
- # create or overwrite
19
- new_file.puts(original_lines)
20
- end
21
- end
22
-
23
4
  require 'logstash-core/version'
24
5
 
25
6
  Gem::Specification.new do |gem|
@@ -30,14 +11,11 @@ Gem::Specification.new do |gem|
30
11
  gem.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
31
12
  gem.license = "Apache License (2.0)"
32
13
 
33
- gem.files = Dir.glob(
34
- %w(versions-gem-copy.yml logstash-core.gemspec gemspec_jars.rb lib/**/*.rb spec/**/*.rb locales/*
35
- lib/logstash/api/init.ru lib/logstash-core/logstash-core.jar)
36
- )
14
+ gem.files = Dir.glob(["logstash-core.gemspec", "gemspec_jars.rb", "lib/**/*.rb", "spec/**/*.rb", "locales/*", "lib/logstash/api/init.ru", "lib/logstash-core/logstash-core.jar"])
37
15
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
38
16
  gem.name = "logstash-core"
39
17
  gem.require_paths = ["lib"]
40
- gem.version = LOGSTASH_CORE_VERSION
18
+ gem.version = LOGSTASH_CORE_VERSION.gsub("-", ".")
41
19
 
42
20
  gem.platform = "java"
43
21
 
@@ -46,15 +24,12 @@ Gem::Specification.new do |gem|
46
24
  gem.add_runtime_dependency "clamp", "~> 0.6.5" #(MIT license) for command line args/flags
47
25
  gem.add_runtime_dependency "filesize", "0.0.4" #(MIT license) for :bytes config validator
48
26
  gem.add_runtime_dependency "gems", "~> 0.8.3" #(MIT license)
49
- gem.add_runtime_dependency "concurrent-ruby", "~> 1.0", ">= 1.0.5"
50
-
51
- # Later versions are ruby 2.0 only. We should remove the rack dep once we support 9k
52
- gem.add_runtime_dependency "rack", '1.6.6'
53
-
27
+ gem.add_runtime_dependency "concurrent-ruby", "1.0.0"
54
28
  gem.add_runtime_dependency "sinatra", '~> 1.4', '>= 1.4.6'
55
29
  gem.add_runtime_dependency 'puma', '~> 2.16'
56
- gem.add_runtime_dependency "jruby-openssl", "~> 0.10.1" # >= 0.9.13 Required to support TLSv1.2
30
+ gem.add_runtime_dependency "jruby-openssl", "0.9.16" # >= 0.9.13 Required to support TLSv1.2
57
31
  gem.add_runtime_dependency "chronic_duration", "0.10.6"
32
+ gem.add_runtime_dependency "jrmonitor", '~> 0.4.2'
58
33
 
59
34
  # TODO(sissel): Treetop 1.5.x doesn't seem to work well, but I haven't
60
35
  # investigated what the cause might be. -Jordan
@@ -64,19 +39,17 @@ Gem::Specification.new do |gem|
64
39
  gem.add_runtime_dependency "i18n", "= 0.6.9" #(MIT license)
65
40
 
66
41
  # filetools and rakelib
67
- gem.add_runtime_dependency "minitar", "~> 0.6.1"
68
- gem.add_runtime_dependency "rubyzip", "~> 1.2.1"
42
+ gem.add_runtime_dependency "minitar", "~> 0.5.4"
43
+ gem.add_runtime_dependency "rubyzip", "~> 1.1.7"
69
44
  gem.add_runtime_dependency "thread_safe", "~> 0.3.5" #(Apache 2.0 license)
70
45
 
71
- gem.add_runtime_dependency "jrjackson", "= #{ALL_VERSIONS.fetch('jrjackson')}" #(Apache 2.0 license)
46
+ gem.add_runtime_dependency "jrjackson", "~> 0.4.2" #(Apache 2.0 license)
72
47
 
73
48
  gem.add_runtime_dependency "jar-dependencies"
74
49
  # as of Feb 3rd 2016, the ruby-maven gem is resolved to version 3.3.3 and that version
75
50
  # has an rdoc problem that causes a bundler exception. 3.3.9 is the current latest version
76
51
  # which does not have this problem.
77
52
  gem.add_runtime_dependency "ruby-maven", "~> 3.3.9"
78
- gem.add_runtime_dependency "elasticsearch", "~> 5.0", ">= 5.0.4" # Ruby client for ES (Apache 2.0 license)
79
- gem.add_runtime_dependency "manticore", '>= 0.5.4', '< 1.0.0'
80
53
 
81
54
  eval(File.read(File.expand_path("../gemspec_jars.rb", __FILE__)))
82
55
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require "spec_helper"
2
+ require_relative "../../spec_helper"
3
3
  require "sinatra"
4
4
  require "logstash/api/modules/logging"
5
5
  require "logstash/json"
@@ -10,6 +10,15 @@ describe LogStash::Api::Modules::Logging do
10
10
  describe "#logging" do
11
11
 
12
12
  context "when setting a logger's log level" do
13
+ before(:all) do
14
+ @runner = LogStashRunner.new
15
+ @runner.start
16
+ end
17
+
18
+ after(:all) do
19
+ @runner.stop
20
+ end
21
+
13
22
  it "should return a positive acknowledgement on success" do
14
23
  put '/', '{"logger.logstash": "ERROR"}'
15
24
  payload = LogStash::Json.load(last_response.body)
@@ -1,5 +1,6 @@
1
1
  # encoding: utf-8
2
- require "spec_helper"
2
+ require_relative "../../../support/shared_examples"
3
+ require_relative "../../spec_helper"
3
4
  require "sinatra"
4
5
  require "logstash/api/modules/plugins"
5
6
  require "logstash/json"
@@ -1,5 +1,6 @@
1
1
  # encoding: utf-8
2
- require "spec_helper"
2
+ require_relative "../../spec_helper"
3
+ require_relative "../../../support/shared_examples"
3
4
  require "sinatra"
4
5
  require "logstash/api/modules/node"
5
6
  require "logstash/json"
@@ -114,8 +115,7 @@ describe LogStash::Api::Modules::Node do
114
115
  "batch_size" => Numeric,
115
116
  "batch_delay" => Numeric,
116
117
  "config_reload_automatic" => Boolean,
117
- "config_reload_interval" => Numeric,
118
- "dead_letter_queue_enabled" => Boolean
118
+ "config_reload_interval" => Numeric
119
119
  },
120
120
  "os" => {
121
121
  "name" => String,
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
- require "spec_helper"
3
-
2
+ require_relative "../../spec_helper"
3
+ require_relative "../../../support/shared_examples"
4
4
  require "sinatra"
5
5
  require "logstash/api/modules/node_stats"
6
6
  require "logstash/json"
@@ -70,7 +70,7 @@ describe LogStash::Api::Modules::NodeStats do
70
70
  "cpu"=>{
71
71
  "total_in_millis"=>Numeric,
72
72
  "percent"=>Numeric,
73
- # load_average is not supported on Windows, set it below
73
+ "load_average" => { "1m" => Numeric }
74
74
  }
75
75
  },
76
76
  "pipeline" => {
@@ -88,9 +88,5 @@ describe LogStash::Api::Modules::NodeStats do
88
88
  }
89
89
  }
90
90
 
91
- unless LogStash::Environment.windows?
92
- root_structure["process"]["cpu"]["load_average"] = { "1m" => Numeric }
93
- end
94
-
95
91
  test_api_and_resources(root_structure)
96
92
  end
@@ -1,5 +1,6 @@
1
1
  # encoding: utf-8
2
- require "spec_helper"
2
+ require_relative "../../spec_helper"
3
+ require_relative "../../../support/shared_examples"
3
4
  require "sinatra"
4
5
  require "logstash/api/modules/plugins"
5
6
  require "logstash/json"
@@ -39,9 +40,7 @@ describe LogStash::Api::Modules::Plugins do
39
40
 
40
41
  it "return a list of available plugins" do
41
42
  payload["plugins"].each do |plugin|
42
- expect do
43
- Gem::Specification.find_by_name(plugin["name"])
44
- end.not_to raise_error
43
+ expect(plugin).to be_available?
45
44
  end
46
45
  end
47
46
 
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
- require "spec_helper"
3
-
2
+ require_relative "../../spec_helper"
3
+ require_relative "../../../support/shared_examples"
4
4
  require "sinatra"
5
5
  require "logstash/api/modules/root"
6
6
  require "logstash/json"