logstash-core 5.4.3-java → 5.5.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash-core/logstash-core.jar +0 -0
- data/lib/logstash-core/version.rb +1 -1
- data/lib/logstash/api/commands/hot_threads_reporter.rb +2 -2
- data/lib/logstash/api/commands/node.rb +0 -1
- data/lib/logstash/api/commands/stats.rb +0 -1
- data/lib/logstash/config/mixin.rb +5 -43
- data/lib/logstash/config/modules_common.rb +71 -0
- data/lib/logstash/elasticsearch_client.rb +120 -0
- data/lib/logstash/environment.rb +14 -3
- data/lib/logstash/errors.rb +1 -0
- data/lib/logstash/execution_context.rb +11 -3
- data/lib/logstash/inputs/base.rb +2 -0
- data/lib/logstash/instrument/global_metrics.rb +13 -0
- data/lib/logstash/instrument/metric_type/mean.rb +5 -0
- data/lib/logstash/instrument/periodic_poller/jvm.rb +5 -5
- data/lib/logstash/logging/logger.rb +26 -1
- data/lib/logstash/modules/cli_parser.rb +74 -0
- data/lib/logstash/modules/elasticsearch_config.rb +22 -0
- data/lib/logstash/modules/elasticsearch_resource.rb +10 -0
- data/lib/logstash/modules/file_reader.rb +36 -0
- data/lib/logstash/modules/importer.rb +37 -0
- data/lib/logstash/modules/kibana_base_resource.rb +10 -0
- data/lib/logstash/modules/kibana_config.rb +104 -0
- data/lib/logstash/modules/kibana_resource.rb +10 -0
- data/lib/logstash/modules/logstash_config.rb +48 -0
- data/lib/logstash/modules/resource_base.rb +37 -0
- data/lib/logstash/modules/scaffold.rb +44 -0
- data/lib/logstash/namespace.rb +1 -0
- data/lib/logstash/outputs/base.rb +2 -0
- data/lib/logstash/pipeline.rb +18 -4
- data/lib/logstash/plugin.rb +1 -0
- data/lib/logstash/plugins/registry.rb +5 -0
- data/lib/logstash/runner.rb +42 -2
- data/lib/logstash/settings.rb +7 -1
- data/lib/logstash/timestamp.rb +4 -0
- data/lib/logstash/util/dead_letter_queue_manager.rb +61 -0
- data/lib/logstash/util/safe_uri.rb +130 -11
- data/lib/logstash/util/thread_dump.rb +3 -1
- data/lib/logstash/util/wrapped_acked_queue.rb +24 -6
- data/lib/logstash/util/wrapped_synchronous_queue.rb +19 -5
- data/lib/logstash/version.rb +1 -1
- data/locales/en.yml +46 -0
- data/logstash-core.gemspec +7 -2
- data/spec/{api/lib/commands/stats.rb → logstash/api/commands/stats_spec.rb} +7 -2
- data/spec/{api/lib → logstash/api}/errors_spec.rb +1 -1
- data/spec/{api/lib/api → logstash/api/modules}/logging_spec.rb +1 -10
- data/spec/{api/lib/api → logstash/api/modules}/node_plugins_spec.rb +2 -3
- data/spec/{api/lib/api → logstash/api/modules}/node_spec.rb +6 -7
- data/spec/{api/lib/api → logstash/api/modules}/node_stats_spec.rb +2 -2
- data/spec/{api/lib/api → logstash/api/modules}/plugins_spec.rb +4 -3
- data/spec/{api/lib/api → logstash/api/modules}/root_spec.rb +3 -3
- data/spec/{api/lib → logstash/api}/rack_app_spec.rb +0 -0
- data/spec/logstash/config/mixin_spec.rb +2 -2
- data/spec/logstash/execution_context_spec.rb +20 -1
- data/spec/logstash/filter_delegator_spec.rb +2 -1
- data/spec/logstash/inputs/base_spec.rb +1 -1
- data/spec/logstash/output_delegator_spec.rb +2 -1
- data/spec/logstash/outputs/base_spec.rb +1 -1
- data/spec/logstash/pipeline_dlq_commit_spec.rb +107 -0
- data/spec/logstash/pipeline_pq_file_spec.rb +1 -1
- data/spec/logstash/plugin_spec.rb +1 -1
- data/spec/logstash/plugins/registry_spec.rb +22 -5
- data/spec/logstash/runner_spec.rb +122 -19
- data/spec/logstash/settings_spec.rb +91 -0
- data/spec/logstash/timestamp_spec.rb +6 -0
- data/spec/support/helpers.rb +80 -1
- data/spec/support/matchers.rb +13 -0
- data/spec/support/shared_contexts.rb +38 -0
- data/spec/support/shared_examples.rb +1 -1
- metadata +95 -40
- data/spec/api/lib/api/support/resource_dsl_methods.rb +0 -87
- data/spec/api/spec_helper.rb +0 -111
data/spec/api/spec_helper.rb
DELETED
@@ -1,111 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
API_ROOT = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "lib", "logstash", "api"))
|
3
|
-
|
4
|
-
require "stud/task"
|
5
|
-
require "logstash/devutils/rspec/spec_helper"
|
6
|
-
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
|
7
|
-
require "lib/api/support/resource_dsl_methods"
|
8
|
-
require_relative "../support/mocks_classes"
|
9
|
-
require 'rspec/expectations'
|
10
|
-
require "logstash/settings"
|
11
|
-
require 'rack/test'
|
12
|
-
require 'rspec'
|
13
|
-
require "json"
|
14
|
-
|
15
|
-
def read_fixture(name)
|
16
|
-
path = File.join(File.dirname(__FILE__), "fixtures", name)
|
17
|
-
File.read(path)
|
18
|
-
end
|
19
|
-
|
20
|
-
module LogStash
|
21
|
-
class DummyAgent < Agent
|
22
|
-
def start_webserver
|
23
|
-
http_address = "#{Socket.gethostname}:#{::LogStash::WebServer::DEFAULT_PORTS.first}"
|
24
|
-
@webserver = Struct.new(:address).new(http_address)
|
25
|
-
self.metric.gauge([], :http_address, http_address)
|
26
|
-
end
|
27
|
-
def stop_webserver; end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
##
|
32
|
-
# Class used to wrap and manage the execution of an agent for test,
|
33
|
-
# this helps a lot in order to have a more integrated test for the
|
34
|
-
# web api, could be also used for other use cases if generalized enough
|
35
|
-
##
|
36
|
-
class LogStashRunner
|
37
|
-
|
38
|
-
attr_reader :config_str, :agent, :pipeline_settings
|
39
|
-
|
40
|
-
def initialize
|
41
|
-
@config_str = "input { generator {count => 100 } } output { dummyoutput {} }"
|
42
|
-
|
43
|
-
args = {
|
44
|
-
"config.reload.automatic" => false,
|
45
|
-
"metric.collect" => true,
|
46
|
-
"log.level" => "debug",
|
47
|
-
"node.name" => "test_agent",
|
48
|
-
"http.port" => rand(9600..9700),
|
49
|
-
"http.environment" => "test",
|
50
|
-
"config.string" => @config_str,
|
51
|
-
"pipeline.batch.size" => 1,
|
52
|
-
"pipeline.workers" => 1
|
53
|
-
}
|
54
|
-
@settings = ::LogStash::SETTINGS.clone.merge(args)
|
55
|
-
|
56
|
-
@agent = LogStash::DummyAgent.new(@settings)
|
57
|
-
end
|
58
|
-
|
59
|
-
def start
|
60
|
-
# We start a pipeline that will generate a finite number of events
|
61
|
-
# before starting the expectations
|
62
|
-
agent.register_pipeline(@settings)
|
63
|
-
@agent_task = Stud::Task.new { agent.execute }
|
64
|
-
@agent_task.wait
|
65
|
-
end
|
66
|
-
|
67
|
-
def stop
|
68
|
-
agent.shutdown
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
##
|
73
|
-
# Method used to wrap up a request in between of a running
|
74
|
-
# pipeline, this makes the whole execution model easier and
|
75
|
-
# more contained as some threads might go wild.
|
76
|
-
##
|
77
|
-
def do_request(&block)
|
78
|
-
runner = LogStashRunner.new
|
79
|
-
runner.start
|
80
|
-
ret_val = block.call
|
81
|
-
runner.stop
|
82
|
-
ret_val
|
83
|
-
end
|
84
|
-
|
85
|
-
RSpec::Matchers.define :be_available? do
|
86
|
-
match do |plugin|
|
87
|
-
begin
|
88
|
-
Gem::Specification.find_by_name(plugin["name"])
|
89
|
-
true
|
90
|
-
rescue
|
91
|
-
false
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
shared_context "api setup" do
|
97
|
-
before :all do
|
98
|
-
@runner = LogStashRunner.new
|
99
|
-
@runner.start
|
100
|
-
end
|
101
|
-
|
102
|
-
after :all do
|
103
|
-
@runner.stop
|
104
|
-
end
|
105
|
-
|
106
|
-
include Rack::Test::Methods
|
107
|
-
|
108
|
-
def app()
|
109
|
-
described_class.new(nil, @runner.agent)
|
110
|
-
end
|
111
|
-
end
|