logstash-output-custom-solr 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/logstash/outputs/solr.rb +14 -0
- data/logstash-output-custom-solr.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e8d36ffe58c415d72da31b08f3b2e3678d9deb61ae2b7deb5ed500674150062
|
4
|
+
data.tar.gz: 5f9363c482e2d8054af5ea5dcb3a1c5ff74e400c9859254ea2d8a93dcc1a78d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5740cfaab73d7102b06f95be3448419583366fefa8e19ec4dd22f9604fe351e8be31dcaea7eef07244a826429788fe3c1de333272adcd3e3daa19ce99479a33
|
7
|
+
data.tar.gz: d121012fdfa6e63995e32ede417210c9bc7874a5fe73c0f8d6c8e34006a79197608167158fc3305889e5d404a1c5cf29b787cfe48ca19851714d5a73d8ab2e08
|
@@ -25,6 +25,12 @@ class LogStash::Outputs::Solr < LogStash::Outputs::Base
|
|
25
25
|
# Commit every batch?
|
26
26
|
config :commit, :validate => :boolean, :default => false
|
27
27
|
|
28
|
+
# A field name of unique key in the Solr schema.xml (default id)
|
29
|
+
config :unique_key_field, :validate => :string, :default => 'id'
|
30
|
+
|
31
|
+
# A field name of event timestamp in the Solr schema.xml (default event_timestamp).
|
32
|
+
config :timestamp_field, :validate => :string, :default => 'timestamp_tdt'
|
33
|
+
|
28
34
|
# Solr commitWithin parameter
|
29
35
|
config :commitWithin, :validate => :number, :default => 10000
|
30
36
|
|
@@ -76,6 +82,14 @@ class LogStash::Outputs::Solr < LogStash::Outputs::Base
|
|
76
82
|
events.each do |event|
|
77
83
|
document = event.to_hash()
|
78
84
|
|
85
|
+
unless document.has_key?(@unique_key) then
|
86
|
+
document.merge!({@unique_key => SecureRandom.uuid})
|
87
|
+
end
|
88
|
+
|
89
|
+
unless document.has_key?(@timestamp_field) then
|
90
|
+
document.merge!({@timestamp_field => document['@timestamp']})
|
91
|
+
end
|
92
|
+
|
79
93
|
@logger.info 'Record: %s' % document.inspect
|
80
94
|
|
81
95
|
documents.push(document)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-custom-solr'
|
3
|
-
s.version = "0.1.
|
3
|
+
s.version = "0.1.7"
|
4
4
|
s.licenses = ["Apache License (2.0)"]
|
5
5
|
s.summary = "Logstash output plugin for sending data to Solr."
|
6
6
|
s.description = "Logstash output plugin for sending data to Solr. It supports SolrCloud, not only Standalone Solr."
|