fluent-plugin-output-solr 0.2.3 → 0.2.4

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
  SHA1:
3
- metadata.gz: 8acc7d9e4641d918c14e4a74ae86d63fc1266dbe
4
- data.tar.gz: 9ce2c1d1d77987d8a3443a9d78cfb88194011ef0
3
+ metadata.gz: d1c6f8222ca0caa3aab7d45245fabcb11e366829
4
+ data.tar.gz: 9a764db856bc8c0a929d69cb83513d02c05cac6b
5
5
  SHA512:
6
- metadata.gz: 8110587864cbe43bf1bd6d3c2cd6c7f872a6f3dca77e74eb35a960439693f956e620fea2b3c78cc8362586e1e7982ee5bebce56780e6b2decf56978e515772cc
7
- data.tar.gz: f92f9c63c28ae9bfab7aeb4aea7111e3cc9d24d35395e8a0121d2f5a3b8f305fdaf86d1dcec960737d717c433a5fd51ffa32da68bd064737fbf5d9a05f5f453d
6
+ metadata.gz: 98e5f570b06cb21f647bd716adeacf1ae97860153c4a0786d1be1c3bd51cacc373ae0e4a71ddcb7f271635989112455289dde153979383a4b4e5a0e8de3a007e
7
+ data.tar.gz: 8328972f13b14dfe7660d16e630e6ae7a8076f7a7ca370d018f557a8e6dbd00b43cbcf1fd27bdb66a40b6459d5a66bd523652605679edcb264b0c360a396f5fb
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-output-solr"
7
- spec.version = "0.2.3"
7
+ spec.version = "0.2.4"
8
8
  spec.authors = ["Minoru Osuka"]
9
9
  spec.email = ["minoru.osuka@gmail.com"]
10
10
 
@@ -120,12 +120,15 @@ module Fluent
120
120
  record.merge!({@timestamp_field => Time.at(time).utc.strftime('%FT%TZ')})
121
121
  end
122
122
 
123
- if @ignore_undefined_fields then
123
+ log.info record
124
+
125
+ if to_boolean(@ignore_undefined_fields) then
124
126
  record.each_key do |key|
125
127
  unless @fields.include?(key) then
126
128
  record.delete(key)
127
129
  end
128
130
  end
131
+ log.info record
129
132
  end
130
133
 
131
134
  documents << record
@@ -139,6 +142,12 @@ module Fluent
139
142
  update documents unless documents.empty?
140
143
  end
141
144
 
145
+ def to_boolean(string)
146
+ return true if string== true || string =~ (/(true|t|yes|y|1)$/i)
147
+ return false if string== false || string.nil? || string =~ (/(false|f|no|n|0)$/i)
148
+ raise ArgumentError.new("invalid value for Boolean: \"#{string}\"")
149
+ end
150
+
142
151
  def update(documents)
143
152
  if @mode == MODE_STANDALONE then
144
153
  @solr.add documents, :params => {:commit => true}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-output-solr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Minoru Osuka