fluent-plugin-influxdb 0.2.1 → 0.2.2
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 +4 -4
- data/History.md +5 -0
- data/README.md +2 -2
- data/fluent-plugin-influxdb.gemspec +1 -1
- data/lib/fluent/plugin/out_influxdb.rb +16 -12
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 669c3b535b02de2911b23d4031733d428ae0c2c9
|
4
|
+
data.tar.gz: 281bc8576f08186c507fc0101190df7dcc5e90d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65dd2cecf483c1ca25a0d57aff6322344785048830970d79cee2572eead29d544a4f98f7b2bb33c2b9a03b94cb96f04cbc1c6fb213aac70526eb1cf62c9f2a38
|
7
|
+
data.tar.gz: e62c1259376e4cf34a21475a1d0187b868a18aa8a69beb13f6bedc314f95ef789b3f14723aff461d5842dec3a33de9301b94dc9d08b7e4c8e18a898c14625ec2
|
data/History.md
CHANGED
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 (
|
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 [
|
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.
|
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
|
-
|
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
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
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.
|
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-
|
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.
|
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
|