mantis-logstash-output-solr_http 3.0.5.pre.m4 → 3.0.5.pre.m9

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: 7e312a23715f960ec3aff18884337fdfad812e45affbd3560b762fa9fcf03068
4
- data.tar.gz: 3e48d7f1ddf3ec8cebb26485dbb7d2e16ba97dc21c1740d8d0626621a5de38d8
3
+ metadata.gz: 2571a640135564746a180702a6f360b97a09f942116bf86ff61249ac989976f5
4
+ data.tar.gz: d6e27a7c62cb228880cf8dba26e057395d1c76351dc10026ee19d1d3d1d1a361
5
5
  SHA512:
6
- metadata.gz: 789dc0e6587391e86f43ec2a1d76b1637ce844090d2876a44dc015996249f981d455136cb5eeae51941a0bc7adf309e01b08a0c8358bdefab5f5737fde856015
7
- data.tar.gz: cf3c9a0b723f52b6f7aea973ab4a460a2e22bfa03071e36478ea1823218c1077cb083c1932cd33e2bf12fe25789f5714f501df2d1cecfa74078fdb266387f189
6
+ metadata.gz: f6a89896cc25910f3e9fadbc4290506e627f861f437ed9720267042aee21fb5339bc7284a7a40354430a3ebe6902849918da6204b88eb19d702c8f39cab54bda
7
+ data.tar.gz: c0738daf44a9055d9c5ea9ac2cffaa7c7cb69dae81808d697a925013e0bdf179dfa4dbe2b8625a839e96cf4633f94f9871f85efdd949c6b121b638391840c81f
@@ -39,6 +39,9 @@ class LogStash::Outputs::SolrHTTP < LogStash::Outputs::Base
39
39
  # '%{foo}' so you can assign your own IDs
40
40
  config :document_id, :validate => :string, :default => nil
41
41
 
42
+ # Solr field name of document ID field name.
43
+ config :document_id_field, :validate => :string, :default => "id"
44
+
42
45
  public
43
46
  def register
44
47
  require "rsolr"
@@ -51,38 +54,37 @@ class LogStash::Outputs::SolrHTTP < LogStash::Outputs::Base
51
54
 
52
55
  public
53
56
  def receive(event)
54
-
55
57
  buffer_receive(event)
56
58
  end #def receive
57
59
 
58
- public
59
60
  public
60
61
  def flush(events, close=false)
61
- documents = Hash.new
62
-
62
+ documents = Hash.new #this is the map of hashes that we push to Solr as documents
63
63
  events.each do |event|
64
- url = event.sprintf(@solr_url)
64
+ url = event.sprintf(@solr_url) # solr url sprintf
65
65
 
66
- if documents[url].nil?
67
- documents[url]=[]
68
- end
69
-
70
- document = event.to_hash()
71
-
66
+ if documents[url].nil?
67
+ documents[url]=[] # create a new array to url
68
+ @logger.debug("new url created [#{url}]")
69
+ end
70
+ document = event.to_hash()
72
71
  if @document_id.nil?
73
- document ["id"] = UUIDTools::UUID.random_create #add a unique ID
72
+ document [@document_id_field] = UUIDTools::UUID.random_create #add a unique ID
74
73
  else
75
- document ["id"] = event.sprintf(@document_id) #or use the one provided
74
+ document [@document_id_field] = event.sprintf(@document_id) #or use the one provided
76
75
  end
77
76
  documents[url].push(document)
78
77
  end
79
-
78
+ @logger.debug("#{documents.keys.length()} url detected")
80
79
  documents.keys.each do |url|
81
80
  solr = RSolr.connect :url => url
81
+ @logger.debug("solr connected [#{url}]")
82
+ @logger.debug("#{documents[url].length()} documents indexing...")
82
83
  solr.add(documents[url])
84
+ @logger.debug("#{documents[url].length()} documents indexed.")
83
85
  end
84
86
 
85
87
  rescue Exception => e
86
88
  @logger.warn("An error occurred while indexing: #{e.message}")
87
89
  end #def flush
88
- end #class LogStash::Outputs::SolrHTTP
90
+ end #class LogStash::Outputs::SolrHTTP
@@ -1,13 +1,13 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'mantis-logstash-output-solr_http'
4
- s.version = '3.0.5-m4'
4
+ s.version = '3.0.5-m9'
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"
8
8
  s.authors = ["Elastic"]
9
- s.email = 'info@mantis.com.tr'
10
- s.homepage = "https://github.com/mantis-software-company/logstash-output-solr_http"
9
+ s.email = 'info@elastic.co'
10
+ s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
11
11
  s.require_paths = ["lib"]
12
12
 
13
13
  # Files
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.m4
4
+ version: 3.0.5.pre.m9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
@@ -89,7 +89,7 @@ dependencies:
89
89
  description: This gem is a Logstash plugin required to be installed on top of the
90
90
  Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
91
91
  gem is not a stand-alone program
92
- email: info@mantis.com.tr
92
+ email: info@elastic.co
93
93
  executables: []
94
94
  extensions: []
95
95
  extra_rdoc_files: []
@@ -104,7 +104,7 @@ files:
104
104
  - lib/logstash/outputs/solr_http.rb
105
105
  - logstash-output-solr_http.gemspec
106
106
  - spec/outputs/solr_http_spec.rb
107
- homepage: https://github.com/mantis-software-company/logstash-output-solr_http
107
+ homepage: http://www.elastic.co/guide/en/logstash/current/index.html
108
108
  licenses:
109
109
  - Apache License (2.0)
110
110
  metadata: