logstash-output-custom-solr 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86a1d9be1b49383ea421b542e8f6b0e3c6c304b6508ec6e816d0b2909c8112a8
4
- data.tar.gz: fbad8b4206fdb73820455507da630268669613dce94d8179a842a979188beb7c
3
+ metadata.gz: 6e8d36ffe58c415d72da31b08f3b2e3678d9deb61ae2b7deb5ed500674150062
4
+ data.tar.gz: 5f9363c482e2d8054af5ea5dcb3a1c5ff74e400c9859254ea2d8a93dcc1a78d5
5
5
  SHA512:
6
- metadata.gz: '099c1b1bb09b013a0933bccf58e0f6535114b7ce062ef7ab6dfc130bea3fb2de6bbffb381f2b8e3594fa007994397291f416b8645645ec1184d2a188fad40e55'
7
- data.tar.gz: 227b28125f95de3a9c11b0767f40f80bca346f2c7085ecdc638a81b0feaea8eec19d1dc4f3184cd2cf6a22115f37a5e1ef029bee0168b00e3bd1e4e34f2de11e
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.6"
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."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-custom-solr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Minoru Osuka