logstash-output-elasticsearch_java 1.0.0 → 2.0.0.beta5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -0
- data/CHANGELOG.md +2 -2
- data/Rakefile +1 -0
- data/lib/logstash/outputs/elasticsearch_java/protocol.rb +27 -19
- data/lib/logstash/outputs/elasticsearch_java.rb +54 -48
- data/logstash-output-elasticsearch_java.gemspec +4 -4
- data/spec/es_spec_helper.rb +3 -3
- data/spec/integration/outputs/index_spec.rb +0 -2
- data/spec/integration/outputs/retry_spec.rb +4 -5
- data/spec/integration/outputs/routing_spec.rb +0 -1
- data/spec/integration/outputs/templates_spec.rb +1 -2
- data/spec/integration/outputs/transport_create_spec.rb +1 -8
- data/spec/integration/outputs/update_spec.rb +1 -0
- data/spec/unit/outputs/elasticsearch/protocol_spec.rb +1 -2
- data/spec/unit/outputs/elasticsearch_spec.rb +1 -9
- data/vendor/jar-dependencies/runtime-jars/HdrHistogram-2.1.6.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/commons-cli-1.3.1.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/compiler-0.8.13.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/compress-lzf-1.0.2.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/elasticsearch-2.0.0-beta1-SNAPSHOT.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/{groovy-all-2.4.4.jar → groovy-all-2.4.4-indy.jar} +0 -0
- data/vendor/jar-dependencies/runtime-jars/guava-18.0.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/hppc-0.7.1.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/jackson-core-2.5.3.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/jackson-dataformat-cbor-2.5.3.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/jackson-dataformat-smile-2.5.3.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/jackson-dataformat-yaml-2.5.3.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/joda-convert-1.2.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/joda-time-2.8.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/jsr166e-1.1.0.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/{lucene-analyzers-common-4.10.4.jar → lucene-analyzers-common-5.2.1.jar} +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-backward-codecs-5.2.1.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-core-5.2.1.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/{lucene-expressions-4.10.4.jar → lucene-expressions-5.2.1.jar} +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-grouping-5.2.1.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-highlighter-5.2.1.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-join-5.2.1.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-memory-5.2.1.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-misc-5.2.1.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-queries-5.2.1.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/{lucene-queryparser-4.10.4.jar → lucene-queryparser-5.2.1.jar} +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-sandbox-5.2.1.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-spatial-5.2.1.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-suggest-5.2.1.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/netty-3.10.3.Final.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/snakeyaml-1.12.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/t-digest-3.0.jar +0 -0
- metadata +69 -50
- data/vendor/jar-dependencies/runtime-jars/elasticsearch-1.7.3.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-core-4.10.4.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-grouping-4.10.4.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-highlighter-4.10.4.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-join-4.10.4.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-memory-4.10.4.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-misc-4.10.4.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-queries-4.10.4.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-sandbox-4.10.4.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-spatial-4.10.4.jar +0 -0
- data/vendor/jar-dependencies/runtime-jars/lucene-suggest-4.10.4.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f921261909c00b735dbc91ff20531ae8411d3c9
|
4
|
+
data.tar.gz: 29619fedd17dbc1ae24aaf8d99d571bbbd9bc756
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6c5796ef190689b9647a4ab081cc7dd00b5f28652d148353d7e306c2e5e385a9f2b121f7bd6859a2e17a9f83649f880c5e3bbb6fe807a59d9b337f598b3867c
|
7
|
+
data.tar.gz: 55e2c01e92cbb836494287a1bec07e5f7aab4eebf1fdfab942ec8dad43dbb5ddf5871da078bc3043c5dcb6a66ad3d93959cc048328a1e28e2a6cb29ead1e26d7
|
data/CHANGELOG.md
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
##
|
2
|
-
- Initial Release.
|
1
|
+
## 2.0.0
|
2
|
+
- Initial Release. Only supports Node/Transport in ES2.x
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "logstash/devutils/rake"
|
@@ -14,6 +14,12 @@ module LogStash
|
|
14
14
|
@logger = Cabin::Channel.get
|
15
15
|
end
|
16
16
|
|
17
|
+
def client
|
18
|
+
return @client if @client
|
19
|
+
@client = build_client(@options)
|
20
|
+
return @client
|
21
|
+
end
|
22
|
+
|
17
23
|
def template_install(name, template, force=false)
|
18
24
|
if template_exists?(name) && !force
|
19
25
|
@logger.debug("Found existing Elasticsearch template. Skipping template management", :name => name)
|
@@ -56,7 +62,7 @@ module LogStash
|
|
56
62
|
|
57
63
|
def self.clear_client()
|
58
64
|
CLIENT_MUTEX.synchronize {
|
59
|
-
@client =
|
65
|
+
@client = null
|
60
66
|
}
|
61
67
|
end
|
62
68
|
|
@@ -82,7 +88,7 @@ module LogStash
|
|
82
88
|
end
|
83
89
|
|
84
90
|
def setup(options={})
|
85
|
-
@settings = org.elasticsearch.common.settings.
|
91
|
+
@settings = org.elasticsearch.common.settings.Settings.settingsBuilder()
|
86
92
|
if options[:hosts]
|
87
93
|
@settings.put("discovery.zen.ping.multicast.enabled", false)
|
88
94
|
@settings.put("discovery.zen.ping.unicast.hosts", NodeClient.hosts(options))
|
@@ -90,6 +96,7 @@ module LogStash
|
|
90
96
|
|
91
97
|
@settings.put("node.client", true)
|
92
98
|
@settings.put("http.enabled", false)
|
99
|
+
@settings.put("path.home", Dir.pwd)
|
93
100
|
|
94
101
|
if options[:client_settings]
|
95
102
|
options[:client_settings].each do |key, value|
|
@@ -207,33 +214,34 @@ module LogStash
|
|
207
214
|
end # def build_request
|
208
215
|
|
209
216
|
def template_exists?(name)
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
217
|
+
return !client.admin.indices.
|
218
|
+
prepareGetTemplates(name).
|
219
|
+
execute().
|
220
|
+
actionGet().
|
221
|
+
getIndexTemplates().
|
222
|
+
isEmpty
|
223
|
+
end # def template_exists?
|
214
224
|
|
215
225
|
def template_put(name, template)
|
216
|
-
|
217
|
-
|
226
|
+
response = client.admin.indices.
|
227
|
+
preparePutTemplate(name).
|
228
|
+
setSource(LogStash::Json.dump(template)).
|
229
|
+
execute().
|
230
|
+
actionGet()
|
218
231
|
|
219
|
-
|
220
|
-
|
221
|
-
end
|
232
|
+
raise "Could not index template!" unless response.isAcknowledged
|
233
|
+
end # template_put
|
222
234
|
|
223
235
|
public(:initialize, :bulk)
|
224
236
|
end # class NodeClient
|
225
237
|
|
226
238
|
class TransportClient < NodeClient
|
227
|
-
def client
|
228
|
-
return @client if @client
|
229
|
-
@client = build_client(@options)
|
230
|
-
return @client
|
231
|
-
end
|
232
|
-
|
233
|
-
|
234
239
|
private
|
235
240
|
def build_client(options)
|
236
|
-
client = org.elasticsearch.client.transport.TransportClient.
|
241
|
+
client = org.elasticsearch.client.transport.TransportClient.
|
242
|
+
builder().
|
243
|
+
settings((settings.build)).
|
244
|
+
build()
|
237
245
|
|
238
246
|
options[:hosts].each do |host|
|
239
247
|
matches = host.match /(.+)(?:.*)/
|
@@ -131,7 +131,6 @@ class LogStash::Outputs::ElasticSearchJava < LogStash::Outputs::Base
|
|
131
131
|
# The name of your cluster if you set it on the Elasticsearch side. Useful
|
132
132
|
# for discovery when using `node` or `transport` protocols.
|
133
133
|
# By default, it looks for a cluster named 'elasticsearch'.
|
134
|
-
# Equivalent to the Elasticsearch option 'cluster.name'
|
135
134
|
config :cluster, :validate => :string
|
136
135
|
|
137
136
|
# For the `node` protocol, if you do not specify `host`, it will attempt to use
|
@@ -175,13 +174,14 @@ class LogStash::Outputs::ElasticSearchJava < LogStash::Outputs::Base
|
|
175
174
|
# * `protocol => node` - port 9300-9305
|
176
175
|
config :port, :validate => :string, :default => "9300-9305"
|
177
176
|
|
178
|
-
# The name/address of the host to bind to for Elasticsearch clustering
|
179
|
-
#
|
180
|
-
# This MUST be set for either protocol to work (node or transport)! The internal Elasticsearch node
|
177
|
+
# The name/address of the host to bind to for Elasticsearch clustering
|
178
|
+
# This MUST be set when the node protocol is used. The internal Elasticsearch node
|
181
179
|
# will bind to this ip. This ip MUST be reachable by all nodes in the Elasticsearch cluster
|
182
180
|
config :network_host, :validate => :string
|
183
181
|
|
184
|
-
# This
|
182
|
+
# This is only valid for the 'node' protocol. This sets the port to bind to on 'network_host'
|
183
|
+
#
|
184
|
+
# The port for the node to listen on.
|
185
185
|
config :transport_tcp_port, :validate => :number
|
186
186
|
|
187
187
|
# This setting no longer does anything. It exists to keep config validation
|
@@ -229,7 +229,10 @@ class LogStash::Outputs::ElasticSearchJava < LogStash::Outputs::Base
|
|
229
229
|
# Elasticsearch cluster to this Logstash server.
|
230
230
|
#
|
231
231
|
# All protocols will use bulk requests when talking to Elasticsearch.
|
232
|
-
|
232
|
+
#
|
233
|
+
# The default `protocol` setting under java/jruby is "node". The default
|
234
|
+
# `protocol` on non-java rubies is "http"
|
235
|
+
config :protocol, :validate => [ "node", "transport"], :default => "node"
|
233
236
|
|
234
237
|
# The Elasticsearch action to perform. Valid actions are: `index`, `delete`.
|
235
238
|
#
|
@@ -270,9 +273,8 @@ class LogStash::Outputs::ElasticSearchJava < LogStash::Outputs::Base
|
|
270
273
|
# Set the truststore password
|
271
274
|
config :keystore_password, :validate => :password
|
272
275
|
|
273
|
-
# Enable cluster sniffing (transport only)
|
276
|
+
# Enable cluster sniffing (transport only)
|
274
277
|
# Asks host for the list of all cluster nodes and adds them to the hosts list
|
275
|
-
# Equivalent to the Elasticsearch option 'client.transport.sniff'
|
276
278
|
config :sniffing, :validate => :boolean, :default => false
|
277
279
|
|
278
280
|
# Set max retry for each event
|
@@ -303,11 +305,47 @@ class LogStash::Outputs::ElasticSearchJava < LogStash::Outputs::Base
|
|
303
305
|
@retry_queue_not_full = ConditionVariable.new
|
304
306
|
@retry_queue = Queue.new
|
305
307
|
|
308
|
+
|
309
|
+
if @protocol =='node' && !@network_host
|
310
|
+
raise LogStash::ConfigurationError, "network_host MUST be set if the 'node' protocol is in use! If this is set incorrectly Logstash will hang attempting to connect!"
|
311
|
+
end
|
312
|
+
|
313
|
+
client_settings = {}
|
314
|
+
client_settings["cluster.name"] = @cluster if @cluster
|
315
|
+
client_settings["network.host"] = @network_host if @network_host
|
316
|
+
client_settings["transport.tcp.port"] = @transport_tcp_port if @transport_tcp_port
|
317
|
+
client_settings["client.transport.sniff"] = @sniffing
|
318
|
+
|
319
|
+
if @node_name
|
320
|
+
client_settings["node.name"] = @node_name
|
321
|
+
else
|
322
|
+
client_settings["node.name"] = "logstash-#{Socket.gethostname}-#{$$}-#{object_id}"
|
323
|
+
end
|
324
|
+
|
325
|
+
@@plugins.each do |plugin|
|
326
|
+
name = plugin.name.split('-')[-1]
|
327
|
+
client_settings.merge!(LogStash::Outputs::ElasticSearchJava.const_get(name.capitalize).create_client_config(self))
|
328
|
+
end
|
329
|
+
|
306
330
|
if (@hosts.nil? || @hosts.empty?) && @protocol != "node" # node can use zen discovery
|
307
331
|
@logger.info("No 'hosts' set in elasticsearch output. Defaulting to localhost")
|
308
332
|
@hosts = ["localhost"]
|
309
333
|
end
|
310
334
|
|
335
|
+
common_options = {
|
336
|
+
:protocol => @protocol,
|
337
|
+
:client_settings => client_settings,
|
338
|
+
:hosts => @hosts,
|
339
|
+
:port => @port
|
340
|
+
}
|
341
|
+
|
342
|
+
# Update API setup
|
343
|
+
update_options = {
|
344
|
+
:upsert => @upsert,
|
345
|
+
:doc_as_upsert => @doc_as_upsert
|
346
|
+
}
|
347
|
+
common_options.merge! update_options if @action == 'update'
|
348
|
+
|
311
349
|
client_class = case @protocol
|
312
350
|
when "transport"
|
313
351
|
LogStash::Outputs::ElasticSearchJavaPlugins::Protocols::TransportClient
|
@@ -315,7 +353,7 @@ class LogStash::Outputs::ElasticSearchJava < LogStash::Outputs::Base
|
|
315
353
|
LogStash::Outputs::ElasticSearchJavaPlugins::Protocols::NodeClient
|
316
354
|
end
|
317
355
|
|
318
|
-
@client = client_class.new(
|
356
|
+
@client = client_class.new(common_options)
|
319
357
|
|
320
358
|
if @manage_template
|
321
359
|
begin
|
@@ -325,7 +363,6 @@ class LogStash::Outputs::ElasticSearchJava < LogStash::Outputs::Base
|
|
325
363
|
@logger.error("Failed to install template",
|
326
364
|
:message => e.message,
|
327
365
|
:error_class => e.class.name,
|
328
|
-
:backtrace => e.backtrace
|
329
366
|
)
|
330
367
|
end
|
331
368
|
end
|
@@ -354,41 +391,6 @@ class LogStash::Outputs::ElasticSearchJava < LogStash::Outputs::Base
|
|
354
391
|
end
|
355
392
|
end # def register
|
356
393
|
|
357
|
-
def client_options
|
358
|
-
client_settings = {}
|
359
|
-
client_settings["cluster.name"] = @cluster if @cluster
|
360
|
-
client_settings["network.host"] = @network_host if @network_host
|
361
|
-
client_settings["transport.tcp.port"] = @transport_tcp_port if @transport_tcp_port
|
362
|
-
client_settings["client.transport.sniff"] = @sniffing
|
363
|
-
|
364
|
-
if @node_name
|
365
|
-
client_settings["node.name"] = @node_name
|
366
|
-
else
|
367
|
-
client_settings["node.name"] = "logstash-#{Socket.gethostname}-#{$$}-#{object_id}"
|
368
|
-
end
|
369
|
-
|
370
|
-
@@plugins.each do |plugin|
|
371
|
-
name = plugin.name.split('-')[-1]
|
372
|
-
client_settings.merge!(LogStash::Outputs::ElasticSearchJava.const_get(name.capitalize).create_client_config(self))
|
373
|
-
end
|
374
|
-
|
375
|
-
common_options = {
|
376
|
-
:protocol => @protocol,
|
377
|
-
:client_settings => client_settings,
|
378
|
-
:hosts => @hosts,
|
379
|
-
:port => @port
|
380
|
-
}
|
381
|
-
|
382
|
-
# Update API setup
|
383
|
-
update_options = {
|
384
|
-
:upsert => @upsert,
|
385
|
-
:doc_as_upsert => @doc_as_upsert
|
386
|
-
}
|
387
|
-
common_options.merge! update_options if @action == 'update'
|
388
|
-
|
389
|
-
common_options
|
390
|
-
end
|
391
|
-
|
392
394
|
|
393
395
|
public
|
394
396
|
def get_template
|
@@ -406,7 +408,7 @@ class LogStash::Outputs::ElasticSearchJava < LogStash::Outputs::Base
|
|
406
408
|
|
407
409
|
public
|
408
410
|
def receive(event)
|
409
|
-
|
411
|
+
return unless output?(event)
|
410
412
|
|
411
413
|
# block until we have not maxed out our
|
412
414
|
# retry queue. This is applying back-pressure
|
@@ -445,7 +447,7 @@ class LogStash::Outputs::ElasticSearchJava < LogStash::Outputs::Base
|
|
445
447
|
es_actions = actions.map { |a, doc, event| [a, doc, event.to_hash] }
|
446
448
|
@submit_mutex.lock
|
447
449
|
begin
|
448
|
-
bulk_response = client.bulk(es_actions)
|
450
|
+
bulk_response = @client.bulk(es_actions)
|
449
451
|
ensure
|
450
452
|
@submit_mutex.unlock
|
451
453
|
end
|
@@ -477,7 +479,11 @@ class LogStash::Outputs::ElasticSearchJava < LogStash::Outputs::Base
|
|
477
479
|
end # def flush
|
478
480
|
|
479
481
|
public
|
480
|
-
def
|
482
|
+
def teardown
|
483
|
+
if @cacert # remove temporary jks store created from the cacert
|
484
|
+
File.delete(@truststore)
|
485
|
+
end
|
486
|
+
|
481
487
|
@retry_teardown_requested.make_true
|
482
488
|
# First, make sure retry_timer_thread is stopped
|
483
489
|
# to ensure we do not signal a retry based on
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-elasticsearch_java'
|
3
|
-
s.version = '
|
3
|
+
s.version = '2.0.0.beta5'
|
4
4
|
s.licenses = ['apache-2.0']
|
5
5
|
s.summary = "Logstash Output to Elasticsearch using Java node/transport client"
|
6
6
|
s.description = "Output events to elasticsearch using the java client"
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.require_paths = ["lib"]
|
11
11
|
|
12
12
|
# Files
|
13
|
-
s.files =
|
13
|
+
s.files = `git ls-files`.split($\)
|
14
14
|
|
15
15
|
# Tests
|
16
16
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
@@ -20,10 +20,10 @@ Gem::Specification.new do |s|
|
|
20
20
|
|
21
21
|
# Gem dependencies
|
22
22
|
s.add_runtime_dependency 'concurrent-ruby'
|
23
|
-
s.add_runtime_dependency 'elasticsearch', ['>= 1.0.
|
23
|
+
s.add_runtime_dependency 'elasticsearch', ['>= 1.0.10', '~> 1.0']
|
24
24
|
s.add_runtime_dependency 'stud', ['>= 0.0.17', '~> 0.0']
|
25
25
|
s.add_runtime_dependency 'cabin', ['~> 0.6']
|
26
|
-
s.add_runtime_dependency "logstash-core",
|
26
|
+
s.add_runtime_dependency "logstash-core", '>= 1.4.0', '< 2.0.0'
|
27
27
|
|
28
28
|
s.add_development_dependency 'ftw', '~> 0.0.42'
|
29
29
|
s.add_development_dependency 'logstash-input-generator'
|
data/spec/es_spec_helper.rb
CHANGED
@@ -73,9 +73,9 @@ RSpec.configure do |config|
|
|
73
73
|
# do nothing
|
74
74
|
end
|
75
75
|
end
|
76
|
-
end
|
77
76
|
|
78
|
-
|
79
|
-
|
77
|
+
config.after(:each) do
|
78
|
+
LogStash::Outputs::ElasticSearchJavaPlugins::Protocols::NodeClient.clear_client()
|
79
|
+
end
|
80
80
|
end
|
81
81
|
end
|
@@ -53,7 +53,6 @@ describe "an indexer with custom index_type", :integration => true do
|
|
53
53
|
output {
|
54
54
|
elasticsearch_java {
|
55
55
|
hosts => "#{get_host()}"
|
56
|
-
network_host => "#{get_local_host}"
|
57
56
|
port => "#{get_port('transport')}"
|
58
57
|
protocol => "transport"
|
59
58
|
index => "#{index}"
|
@@ -79,7 +78,6 @@ describe "an indexer with no type value set (default to logs)", :integration =>
|
|
79
78
|
output {
|
80
79
|
elasticsearch_java {
|
81
80
|
hosts => "#{get_host()}"
|
82
|
-
network_host => "#{get_local_host}"
|
83
81
|
port => "#{get_port('transport')}"
|
84
82
|
protocol => "transport"
|
85
83
|
index => "#{index}"
|
@@ -21,7 +21,6 @@ describe "failures in bulk class expected behavior", :integration => true do
|
|
21
21
|
"manage_template" => true,
|
22
22
|
"index" => "logstash-2014.11.17",
|
23
23
|
"template_overwrite" => true,
|
24
|
-
"network_host" => get_local_host,
|
25
24
|
"protocol" => 'transport',
|
26
25
|
"hosts" => get_host(),
|
27
26
|
"port" => get_port('transport'),
|
@@ -61,7 +60,7 @@ describe "failures in bulk class expected behavior", :integration => true do
|
|
61
60
|
end
|
62
61
|
subject.register
|
63
62
|
subject.receive(event1)
|
64
|
-
subject.
|
63
|
+
subject.teardown
|
65
64
|
end
|
66
65
|
|
67
66
|
it "should retry actions with response status of 503" do
|
@@ -109,7 +108,7 @@ describe "failures in bulk class expected behavior", :integration => true do
|
|
109
108
|
subject.register
|
110
109
|
subject.receive(invalid_event)
|
111
110
|
expect(subject).not_to receive(:retry_push)
|
112
|
-
subject.
|
111
|
+
subject.teardown
|
113
112
|
|
114
113
|
@es.indices.refresh
|
115
114
|
sleep(5)
|
@@ -123,7 +122,7 @@ describe "failures in bulk class expected behavior", :integration => true do
|
|
123
122
|
subject.register
|
124
123
|
subject.receive(event1)
|
125
124
|
expect(subject).not_to receive(:retry_push)
|
126
|
-
subject.
|
125
|
+
subject.teardown
|
127
126
|
|
128
127
|
@es.indices.refresh
|
129
128
|
sleep(5)
|
@@ -137,7 +136,7 @@ describe "failures in bulk class expected behavior", :integration => true do
|
|
137
136
|
subject.register
|
138
137
|
subject.receive(invalid_event)
|
139
138
|
subject.receive(event1)
|
140
|
-
subject.
|
139
|
+
subject.teardown
|
141
140
|
@es.indices.refresh
|
142
141
|
sleep(5)
|
143
142
|
|
@@ -11,8 +11,7 @@ describe "index template expected behavior", :integration => true do
|
|
11
11
|
"template_overwrite" => true,
|
12
12
|
"protocol" => protocol,
|
13
13
|
"hosts" => "#{get_host()}",
|
14
|
-
"port" => "#{get_port('transport')}"
|
15
|
-
"network_host" => get_local_host
|
14
|
+
"port" => "#{get_port('transport')}"
|
16
15
|
}
|
17
16
|
next LogStash::Outputs::ElasticSearchJava.new(settings)
|
18
17
|
end
|
@@ -12,8 +12,7 @@ describe "transport client create actions", :integration => true do
|
|
12
12
|
"protocol" => "transport",
|
13
13
|
"hosts" => get_host(),
|
14
14
|
"port" => get_port('transport'),
|
15
|
-
"action" => action
|
16
|
-
"network_host" => get_local_host
|
15
|
+
"action" => action
|
17
16
|
}
|
18
17
|
settings['document_id'] = id unless id.nil?
|
19
18
|
LogStash::Outputs::ElasticSearchJava.new(settings)
|
@@ -29,12 +28,6 @@ describe "transport client create actions", :integration => true do
|
|
29
28
|
end
|
30
29
|
|
31
30
|
context "when action => create" do
|
32
|
-
it "should instantiate a transport, not node, client" do
|
33
|
-
subject = get_es_output("create", "id123")
|
34
|
-
subject.register
|
35
|
-
expect(subject.client.send(:client).class).to eql(Java::OrgElasticsearchClientTransport::TransportClient)
|
36
|
-
end
|
37
|
-
|
38
31
|
it "should create new documents with or without id" do
|
39
32
|
subject = get_es_output("create", "id123")
|
40
33
|
subject.register
|
@@ -12,6 +12,7 @@ describe "all protocols update actions", :integration => true do
|
|
12
12
|
"protocol" => protocol,
|
13
13
|
"hosts" => get_host(),
|
14
14
|
"port" => get_port(protocol),
|
15
|
+
"network_host" => get_local_host,
|
15
16
|
"action" => "update"
|
16
17
|
}
|
17
18
|
settings['upsert'] = upsert unless upsert.nil?
|
@@ -20,13 +20,12 @@ describe LogStash::Outputs::ElasticSearchJavaPlugins::Protocols::NodeClient do
|
|
20
20
|
context "contains failures" do
|
21
21
|
it "should map correctly" do
|
22
22
|
failure = org.elasticsearch.action.bulk.BulkItemResponse::Failure.new("my_index", "my_type", "my_id", java.lang.IllegalArgumentException.new("bad_request"))
|
23
|
-
failure_code = failure.get_status.status
|
24
23
|
bulk_item_response_index = org.elasticsearch.action.bulk.BulkItemResponse.new(32, "index", failure)
|
25
24
|
bulk_item_response_update = org.elasticsearch.action.bulk.BulkItemResponse.new(32, "update", failure)
|
26
25
|
bulk_item_response_delete = org.elasticsearch.action.bulk.BulkItemResponse.new(32, "delete", failure)
|
27
26
|
bulk_response = org.elasticsearch.action.bulk.BulkResponse.new([bulk_item_response_index, bulk_item_response_update, bulk_item_response_delete], 0)
|
28
27
|
actual = LogStash::Outputs::ElasticSearchJavaPlugins::Protocols::NodeClient.normalize_bulk_response(bulk_response)
|
29
|
-
insist { actual } == {"errors" => true, "statuses" => [
|
28
|
+
insist { actual } == {"errors" => true, "statuses" => [400, 400, 400]}
|
30
29
|
end
|
31
30
|
end
|
32
31
|
end
|
@@ -3,11 +3,7 @@ require_relative "../../../spec/es_spec_helper"
|
|
3
3
|
describe "outputs/elasticsearch_java" do
|
4
4
|
context "registration" do
|
5
5
|
it "should register" do
|
6
|
-
output = LogStash::Plugin.lookup("output", "elasticsearch_java").new(
|
7
|
-
"protocol" => "transport",
|
8
|
-
"network_host" => get_local_host,
|
9
|
-
"manage_template" => "false"
|
10
|
-
)
|
6
|
+
output = LogStash::Plugin.lookup("output", "elasticsearch_java").new("protocol" => "transport", "manage_template" => "false")
|
11
7
|
# register will try to load jars and raise if it cannot find jars
|
12
8
|
expect {output.register}.to_not raise_error
|
13
9
|
end
|
@@ -19,7 +15,6 @@ describe "outputs/elasticsearch_java" do
|
|
19
15
|
require "logstash/outputs/elasticsearch_java"
|
20
16
|
settings = {
|
21
17
|
"protocol" => "transport",
|
22
|
-
"network_host" => get_local_host,
|
23
18
|
"node_name" => "mynode"
|
24
19
|
}
|
25
20
|
next LogStash::Outputs::ElasticSearchJava.new(settings)
|
@@ -32,7 +27,6 @@ describe "outputs/elasticsearch_java" do
|
|
32
27
|
:protocol => "transport",
|
33
28
|
:client_settings => {
|
34
29
|
"client.transport.sniff" => false,
|
35
|
-
"network.host" => get_local_host,
|
36
30
|
"node.name" => "mynode"
|
37
31
|
}
|
38
32
|
})
|
@@ -46,7 +40,6 @@ describe "outputs/elasticsearch_java" do
|
|
46
40
|
settings = {
|
47
41
|
"hosts" => "node01",
|
48
42
|
"protocol" => "transport",
|
49
|
-
"network_host" => get_local_host,
|
50
43
|
"sniffing" => true
|
51
44
|
}
|
52
45
|
next LogStash::Outputs::ElasticSearchJava.new(settings)
|
@@ -68,7 +61,6 @@ describe "outputs/elasticsearch_java" do
|
|
68
61
|
settings = {
|
69
62
|
"hosts" => "node01",
|
70
63
|
"protocol" => "transport",
|
71
|
-
"network_host" => get_local_host,
|
72
64
|
"sniffing" => false
|
73
65
|
}
|
74
66
|
next LogStash::Outputs::ElasticSearchJava.new(settings)
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/vendor/jar-dependencies/runtime-jars/{groovy-all-2.4.4.jar → groovy-all-2.4.4-indy.jar}
RENAMED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-elasticsearch_java
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.beta5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
|
-
- -
|
16
|
+
- - ">="
|
17
17
|
- !ruby/object:Gem::Version
|
18
18
|
version: '0'
|
19
19
|
name: concurrent-ruby
|
@@ -21,16 +21,16 @@ dependencies:
|
|
21
21
|
type: :runtime
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
30
|
-
- -
|
30
|
+
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.0.
|
33
|
-
- - ~>
|
32
|
+
version: 1.0.10
|
33
|
+
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '1.0'
|
36
36
|
name: elasticsearch
|
@@ -38,19 +38,19 @@ dependencies:
|
|
38
38
|
type: :runtime
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
|
-
- -
|
41
|
+
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 1.0.
|
44
|
-
- - ~>
|
43
|
+
version: 1.0.10
|
44
|
+
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '1.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
49
|
requirements:
|
50
|
-
- -
|
50
|
+
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: 0.0.17
|
53
|
-
- - ~>
|
53
|
+
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0.0'
|
56
56
|
name: stud
|
@@ -58,16 +58,16 @@ dependencies:
|
|
58
58
|
type: :runtime
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: 0.0.17
|
64
|
-
- - ~>
|
64
|
+
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '0.0'
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
requirement: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
|
-
- - ~>
|
70
|
+
- - "~>"
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '0.6'
|
73
73
|
name: cabin
|
@@ -75,33 +75,33 @@ dependencies:
|
|
75
75
|
type: :runtime
|
76
76
|
version_requirements: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
|
-
- - ~>
|
78
|
+
- - "~>"
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '0.6'
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
requirement: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
|
-
- -
|
84
|
+
- - ">="
|
85
85
|
- !ruby/object:Gem::Version
|
86
|
-
version:
|
87
|
-
- - <
|
86
|
+
version: 1.4.0
|
87
|
+
- - "<"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 2.0.0
|
90
90
|
name: logstash-core
|
91
91
|
prerelease: false
|
92
92
|
type: :runtime
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- -
|
95
|
+
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
98
|
-
- - <
|
97
|
+
version: 1.4.0
|
98
|
+
- - "<"
|
99
99
|
- !ruby/object:Gem::Version
|
100
|
-
version:
|
100
|
+
version: 2.0.0
|
101
101
|
- !ruby/object:Gem::Dependency
|
102
102
|
requirement: !ruby/object:Gem::Requirement
|
103
103
|
requirements:
|
104
|
-
- - ~>
|
104
|
+
- - "~>"
|
105
105
|
- !ruby/object:Gem::Version
|
106
106
|
version: 0.0.42
|
107
107
|
name: ftw
|
@@ -109,13 +109,13 @@ dependencies:
|
|
109
109
|
type: :development
|
110
110
|
version_requirements: !ruby/object:Gem::Requirement
|
111
111
|
requirements:
|
112
|
-
- - ~>
|
112
|
+
- - "~>"
|
113
113
|
- !ruby/object:Gem::Version
|
114
114
|
version: 0.0.42
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
116
|
requirement: !ruby/object:Gem::Requirement
|
117
117
|
requirements:
|
118
|
-
- -
|
118
|
+
- - ">="
|
119
119
|
- !ruby/object:Gem::Version
|
120
120
|
version: '0'
|
121
121
|
name: logstash-input-generator
|
@@ -123,13 +123,13 @@ dependencies:
|
|
123
123
|
type: :development
|
124
124
|
version_requirements: !ruby/object:Gem::Requirement
|
125
125
|
requirements:
|
126
|
-
- -
|
126
|
+
- - ">="
|
127
127
|
- !ruby/object:Gem::Version
|
128
128
|
version: '0'
|
129
129
|
- !ruby/object:Gem::Dependency
|
130
130
|
requirement: !ruby/object:Gem::Requirement
|
131
131
|
requirements:
|
132
|
-
- -
|
132
|
+
- - ">="
|
133
133
|
- !ruby/object:Gem::Version
|
134
134
|
version: '0'
|
135
135
|
name: logstash-devutils
|
@@ -137,13 +137,13 @@ dependencies:
|
|
137
137
|
type: :development
|
138
138
|
version_requirements: !ruby/object:Gem::Requirement
|
139
139
|
requirements:
|
140
|
-
- -
|
140
|
+
- - ">="
|
141
141
|
- !ruby/object:Gem::Version
|
142
142
|
version: '0'
|
143
143
|
- !ruby/object:Gem::Dependency
|
144
144
|
requirement: !ruby/object:Gem::Requirement
|
145
145
|
requirements:
|
146
|
-
- -
|
146
|
+
- - ">="
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0'
|
149
149
|
name: longshoreman
|
@@ -151,7 +151,7 @@ dependencies:
|
|
151
151
|
type: :development
|
152
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
153
|
requirements:
|
154
|
-
- -
|
154
|
+
- - ">="
|
155
155
|
- !ruby/object:Gem::Version
|
156
156
|
version: '0'
|
157
157
|
description: Output events to elasticsearch using the java client
|
@@ -160,12 +160,14 @@ executables: []
|
|
160
160
|
extensions: []
|
161
161
|
extra_rdoc_files: []
|
162
162
|
files:
|
163
|
+
- ".gitignore"
|
163
164
|
- CHANGELOG.md
|
164
165
|
- CONTRIBUTORS
|
165
166
|
- Gemfile
|
166
167
|
- LICENSE
|
167
168
|
- NOTICE.TXT
|
168
169
|
- README.md
|
170
|
+
- Rakefile
|
169
171
|
- lib/logstash-output-elasticsearch_java_jars.rb
|
170
172
|
- lib/logstash/outputs/elasticsearch_java.rb
|
171
173
|
- lib/logstash/outputs/elasticsearch_java/elasticsearch-template.json
|
@@ -182,29 +184,46 @@ files:
|
|
182
184
|
- spec/integration/outputs/update_spec.rb
|
183
185
|
- spec/unit/outputs/elasticsearch/protocol_spec.rb
|
184
186
|
- spec/unit/outputs/elasticsearch_spec.rb
|
187
|
+
- vendor/jar-dependencies/runtime-jars/HdrHistogram-2.1.6.jar
|
185
188
|
- vendor/jar-dependencies/runtime-jars/antlr-runtime-3.5.jar
|
186
189
|
- vendor/jar-dependencies/runtime-jars/apache-log4j-extras-1.2.17.jar
|
187
190
|
- vendor/jar-dependencies/runtime-jars/asm-4.1.jar
|
188
191
|
- vendor/jar-dependencies/runtime-jars/asm-commons-4.1.jar
|
189
|
-
- vendor/jar-dependencies/runtime-jars/
|
190
|
-
- vendor/jar-dependencies/runtime-jars/
|
192
|
+
- vendor/jar-dependencies/runtime-jars/commons-cli-1.3.1.jar
|
193
|
+
- vendor/jar-dependencies/runtime-jars/compiler-0.8.13.jar
|
194
|
+
- vendor/jar-dependencies/runtime-jars/compress-lzf-1.0.2.jar
|
195
|
+
- vendor/jar-dependencies/runtime-jars/elasticsearch-2.0.0-beta1-SNAPSHOT.jar
|
196
|
+
- vendor/jar-dependencies/runtime-jars/groovy-all-2.4.4-indy.jar
|
197
|
+
- vendor/jar-dependencies/runtime-jars/guava-18.0.jar
|
198
|
+
- vendor/jar-dependencies/runtime-jars/hppc-0.7.1.jar
|
199
|
+
- vendor/jar-dependencies/runtime-jars/jackson-core-2.5.3.jar
|
200
|
+
- vendor/jar-dependencies/runtime-jars/jackson-dataformat-cbor-2.5.3.jar
|
201
|
+
- vendor/jar-dependencies/runtime-jars/jackson-dataformat-smile-2.5.3.jar
|
202
|
+
- vendor/jar-dependencies/runtime-jars/jackson-dataformat-yaml-2.5.3.jar
|
191
203
|
- vendor/jar-dependencies/runtime-jars/jna-4.1.0.jar
|
204
|
+
- vendor/jar-dependencies/runtime-jars/joda-convert-1.2.jar
|
205
|
+
- vendor/jar-dependencies/runtime-jars/joda-time-2.8.jar
|
206
|
+
- vendor/jar-dependencies/runtime-jars/jsr166e-1.1.0.jar
|
192
207
|
- vendor/jar-dependencies/runtime-jars/jts-1.13.jar
|
193
208
|
- vendor/jar-dependencies/runtime-jars/log4j-1.2.17.jar
|
194
|
-
- vendor/jar-dependencies/runtime-jars/lucene-analyzers-common-
|
195
|
-
- vendor/jar-dependencies/runtime-jars/lucene-
|
196
|
-
- vendor/jar-dependencies/runtime-jars/lucene-
|
197
|
-
- vendor/jar-dependencies/runtime-jars/lucene-
|
198
|
-
- vendor/jar-dependencies/runtime-jars/lucene-
|
199
|
-
- vendor/jar-dependencies/runtime-jars/lucene-
|
200
|
-
- vendor/jar-dependencies/runtime-jars/lucene-
|
201
|
-
- vendor/jar-dependencies/runtime-jars/lucene-
|
202
|
-
- vendor/jar-dependencies/runtime-jars/lucene-
|
203
|
-
- vendor/jar-dependencies/runtime-jars/lucene-
|
204
|
-
- vendor/jar-dependencies/runtime-jars/lucene-
|
205
|
-
- vendor/jar-dependencies/runtime-jars/lucene-
|
206
|
-
- vendor/jar-dependencies/runtime-jars/lucene-
|
209
|
+
- vendor/jar-dependencies/runtime-jars/lucene-analyzers-common-5.2.1.jar
|
210
|
+
- vendor/jar-dependencies/runtime-jars/lucene-backward-codecs-5.2.1.jar
|
211
|
+
- vendor/jar-dependencies/runtime-jars/lucene-core-5.2.1.jar
|
212
|
+
- vendor/jar-dependencies/runtime-jars/lucene-expressions-5.2.1.jar
|
213
|
+
- vendor/jar-dependencies/runtime-jars/lucene-grouping-5.2.1.jar
|
214
|
+
- vendor/jar-dependencies/runtime-jars/lucene-highlighter-5.2.1.jar
|
215
|
+
- vendor/jar-dependencies/runtime-jars/lucene-join-5.2.1.jar
|
216
|
+
- vendor/jar-dependencies/runtime-jars/lucene-memory-5.2.1.jar
|
217
|
+
- vendor/jar-dependencies/runtime-jars/lucene-misc-5.2.1.jar
|
218
|
+
- vendor/jar-dependencies/runtime-jars/lucene-queries-5.2.1.jar
|
219
|
+
- vendor/jar-dependencies/runtime-jars/lucene-queryparser-5.2.1.jar
|
220
|
+
- vendor/jar-dependencies/runtime-jars/lucene-sandbox-5.2.1.jar
|
221
|
+
- vendor/jar-dependencies/runtime-jars/lucene-spatial-5.2.1.jar
|
222
|
+
- vendor/jar-dependencies/runtime-jars/lucene-suggest-5.2.1.jar
|
223
|
+
- vendor/jar-dependencies/runtime-jars/netty-3.10.3.Final.jar
|
224
|
+
- vendor/jar-dependencies/runtime-jars/snakeyaml-1.12.jar
|
207
225
|
- vendor/jar-dependencies/runtime-jars/spatial4j-0.4.1.jar
|
226
|
+
- vendor/jar-dependencies/runtime-jars/t-digest-3.0.jar
|
208
227
|
homepage: http://logstash.net/
|
209
228
|
licenses:
|
210
229
|
- apache-2.0
|
@@ -217,14 +236,14 @@ require_paths:
|
|
217
236
|
- lib
|
218
237
|
required_ruby_version: !ruby/object:Gem::Requirement
|
219
238
|
requirements:
|
220
|
-
- -
|
239
|
+
- - ">="
|
221
240
|
- !ruby/object:Gem::Version
|
222
241
|
version: '0'
|
223
242
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
224
243
|
requirements:
|
225
|
-
- -
|
244
|
+
- - ">"
|
226
245
|
- !ruby/object:Gem::Version
|
227
|
-
version:
|
246
|
+
version: 1.3.1
|
228
247
|
requirements: []
|
229
248
|
rubyforge_project:
|
230
249
|
rubygems_version: 2.4.8
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|