fluent-plugin-influxdb 0.2.1 → 0.2.2

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: f16a13a54b8ffa49a68b394ac16271ad899ddcd6
4
- data.tar.gz: 3f9e2c54329af62b049fd09aec973d5102f47af1
3
+ metadata.gz: 669c3b535b02de2911b23d4031733d428ae0c2c9
4
+ data.tar.gz: 281bc8576f08186c507fc0101190df7dcc5e90d1
5
5
  SHA512:
6
- metadata.gz: 09d9259e4ee79e9aa76baf8e6a36e2c918011ba0aff7f519a6511ee71f5172cc0a75ebd76947933ca5ef449d4810fd537d75e81c4d77d1f93d28a07e5a44ef7b
7
- data.tar.gz: d8807fa69c444eb2aec7d4d467d13822b5a0054a52799b1e019cf517b29400c7ab8663bd8bb751811d034ee37b2b121d59dcf988fe038a5726d5891879641fa1
6
+ metadata.gz: 65dd2cecf483c1ca25a0d57aff6322344785048830970d79cee2572eead29d544a4f98f7b2bb33c2b9a03b94cb96f04cbc1c6fb213aac70526eb1cf62c9f2a38
7
+ data.tar.gz: e62c1259376e4cf34a21475a1d0187b868a18aa8a69beb13f6bedc314f95ef789b3f14723aff461d5842dec3a33de9301b94dc9d08b7e4c8e18a898c14625ec2
data/History.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 0.2.2 (Nov, 02, 2015)
5
+ =====
6
+
7
+ - Ignore event when field has null
8
+
4
9
  0.2.1 (July, 31, 2015)
5
10
  =====
6
11
 
data/README.md CHANGED
@@ -35,7 +35,7 @@ Just like other regular output plugins, Use type `influxdb` in your fluentd conf
35
35
 
36
36
  `use_ssl`: Use SSL when connecting to influxDB. default to false
37
37
 
38
- `time_precision`: The time precision of timestamp. default to "s". should specify either second (s), millisecond (m), or microsecond (u)
38
+ `time_precision`: The time precision of timestamp. default to "s". should specify either hour (h), minutes (m), second (s), millisecond (ms), microsecond (u), or nanosecond (n)
39
39
 
40
40
  `tag_keys`: The names of the keys to use as influxDB tags.
41
41
 
@@ -56,7 +56,7 @@ So if you have events with `app.event`, influxdb plugin inserts events into `app
56
56
  password mypwd
57
57
  use_ssl false
58
58
  time_precision s
59
- tag_keys ['key1', 'key2']
59
+ tag_keys ["key1", "key2"]
60
60
  </match>
61
61
  ```
62
62
 
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "fluent-plugin-influxdb"
6
- s.version = '0.2.1'
6
+ s.version = '0.2.2'
7
7
  s.authors = ["Masahiro Nakagawa", "FangLi"]
8
8
  s.email = ["repeatedly@gmail.com", "surivlee@gmail.com"]
9
9
  s.description = %q{InfluxDB output plugin for Fluentd}
@@ -36,9 +36,15 @@ class Fluent::InfluxdbOutput < Fluent::BufferedOutput
36
36
  super
37
37
  end
38
38
 
39
+ FORMATTED_RESULT_FOR_INVALID_RECORD = ''.freeze
40
+
39
41
  def format(tag, time, record)
40
42
  # TODO: Use tag based chunk separation for more reliability
41
- [tag, time, record].to_msgpack
43
+ if record.empty? || record.has_value?(nil)
44
+ FORMATTED_RESULT_FOR_INVALID_RECORD
45
+ else
46
+ [tag, time, record].to_msgpack
47
+ end
42
48
  end
43
49
 
44
50
  def shutdown
@@ -48,18 +54,16 @@ class Fluent::InfluxdbOutput < Fluent::BufferedOutput
48
54
  def write(chunk)
49
55
  points = []
50
56
  chunk.msgpack_each do |tag, time, record|
51
- unless record.empty?
52
- point = {}
53
- point[:timestamp] = record.delete('time') || time
54
- point[:series] = tag
55
- if tag_keys.empty?
56
- point[:values] = record
57
- else
58
- point[:tags] = record.select{|k,v| @tag_keys.include?(k)}
59
- point[:values] = record.select{|k,v| !@tag_keys.include?(k)}
60
- end
61
- points << point
57
+ point = {}
58
+ point[:timestamp] = record.delete('time') || time
59
+ point[:series] = tag
60
+ if tag_keys.empty?
61
+ point[:values] = record
62
+ else
63
+ point[:tags] = record.select{|k,v| @tag_keys.include?(k)}
64
+ point[:values] = record.select{|k,v| !@tag_keys.include?(k)}
62
65
  end
66
+ points << point
63
67
  end
64
68
 
65
69
  @influxdb.write_points(points)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-influxdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro Nakagawa
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-31 00:00:00.000000000 Z
12
+ date: 2015-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.2.3
128
+ rubygems_version: 2.4.5.1
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: A buffered output plugin for fluentd and influxDB