mantis-logstash-output-solr_http 3.0.5.pre.m5 → 3.0.5.pre.m6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf56be7da5f62aba197eef67d1d4066e22f412fe8a41e2fd215bed3aaae1677c
4
- data.tar.gz: 458e999a50ceb471830acb813cf09b750b93cdd8b1629b34bc1a56465cd819d4
3
+ metadata.gz: 2ffc7b9002b94861c40bdbc97a052838af119307b5f8a963452e2ff965ab37e3
4
+ data.tar.gz: 677e3af1d72de37c807e5094c2a850d965318f00bc5d54c63ff37e86047d2625
5
5
  SHA512:
6
- metadata.gz: 2d9251fb51cf10ca425b8275c3cb0201bf3b9e518f2b50e4327c36ca149b4a48df7b81ab8e81048fffde989cd9b9cce11d7f06af8ca167a20a65b39e606810e9
7
- data.tar.gz: 7ee0078971e182ad0d6b534730892fbad0f03acbabca77e0b361cc5f960e774fd155aff08ef2b4ee129e0841b4bf080d968c1a17568c0e5ef608add1f7f0873e
6
+ metadata.gz: 1472c640a72b1eb6841e4ed2c87dbfdc631f79b10ecab1d0c59b96edb0fe95483a69dd54db5556416a294326ae2e8f10fffeecd699625d6d870c75051146482d
7
+ data.tar.gz: b3c96a724a21831e6a5a26bd22c4a414b3569e1d40551cb2a5b3beed9273c454555f02573ddda1c84c9a74f649b21032714a55ea38c2106d14c55aa1a32fdb3d
@@ -56,16 +56,16 @@ class LogStash::Outputs::SolrHTTP < LogStash::Outputs::Base
56
56
  buffer_receive(event)
57
57
  end #def receive
58
58
 
59
- public
60
59
  public
61
60
  def flush(events, close=false)
62
- documents = Hash.new
61
+ documents = Hash.new #this is the map of hashes that we push to Solr as documents
63
62
 
64
63
  events.each do |event|
65
- url = event.sprintf(@solr_url)
64
+ url = event.sprintf(@solr_url) # solr url sprintf
66
65
 
67
- if documents[url].nil?
68
- documents[url]=[]
66
+ if documents[url].nil?
67
+ documents[url]=[] # create a new array to url
68
+ @logger.debug("new url created [#{url}]")
69
69
  end
70
70
 
71
71
  document = event.to_hash()
@@ -77,10 +77,14 @@ class LogStash::Outputs::SolrHTTP < LogStash::Outputs::Base
77
77
  end
78
78
  documents[url].push(document)
79
79
  end
80
-
80
+ @logger.debug("#{documents.keys.length()} url detected")
81
81
  documents.keys.each do |url|
82
82
  solr = RSolr.connect :url => url
83
+ @logger.debug("solr connected [#{url}]")
84
+ @logger.debug("#{documents[url].length()} documents indexing...")
83
85
  solr.add(documents[url])
86
+ @logger.debug("#{documents[url].length()} documents indexed.")
87
+ solr.commit, :commit_attributes => {}
84
88
  end
85
89
 
86
90
  rescue Exception => e
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'mantis-logstash-output-solr_http'
4
- s.version = '3.0.5-m5'
4
+ s.version = '3.0.5-m6'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Stores and indexes logs in Solr"
7
7
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mantis-logstash-output-solr_http
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5.pre.m5
4
+ version: 3.0.5.pre.m6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic