fluent-plugin-influxdb 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: 4773755a8ead0cdfa5ecb44d7dcc2a56f1405388
4
- data.tar.gz: 8ae5a2544035c5f852ccc4c1173bf25701cd9021
3
+ metadata.gz: f16a13a54b8ffa49a68b394ac16271ad899ddcd6
4
+ data.tar.gz: 3f9e2c54329af62b049fd09aec973d5102f47af1
5
5
  SHA512:
6
- metadata.gz: 30c63e6ee4dae8a73e6087777fb25c21da02cd5745039d9c9a5b8667a3aeea86d7769c6e0784581b7186a5d85dabb282a58f7a2afbd8ef06dc55d4b0e7c2e9ac
7
- data.tar.gz: 795949221c8242345bcb26e826d080e75c911774fda4eedeb8716aaf98dfb1abf88f3ea239f680f2e24b957d5d8ab1ffced4ae00c05bbced556492e93b948906
6
+ metadata.gz: 09d9259e4ee79e9aa76baf8e6a36e2c918011ba0aff7f519a6511ee71f5172cc0a75ebd76947933ca5ef449d4810fd537d75e81c4d77d1f93d28a07e5a44ef7b
7
+ data.tar.gz: d8807fa69c444eb2aec7d4d467d13822b5a0054a52799b1e019cf517b29400c7ab8663bd8bb751811d034ee37b2b121d59dcf988fe038a5726d5891879641fa1
data/.gitignore CHANGED
@@ -1,3 +1,5 @@
1
1
  *.rbc
2
2
  *.gem
3
3
  .bundle
4
+ Gemfile.lock
5
+ vendor/
data/History.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 0.2.1 (July, 31, 2015)
5
+ =====
6
+
7
+ - Add tag_keys parameter to support influxdb tags
8
+
4
9
  0.2.0 (July, 27, 2015)
5
10
  =====
6
11
 
data/README.md CHANGED
@@ -37,6 +37,8 @@ Just like other regular output plugins, Use type `influxdb` in your fluentd conf
37
37
 
38
38
  `time_precision`: The time precision of timestamp. default to "s". should specify either second (s), millisecond (m), or microsecond (u)
39
39
 
40
+ `tag_keys`: The names of the keys to use as influxDB tags.
41
+
40
42
  ### Fluentd Tag and InfluxDB Series
41
43
 
42
44
  influxdb plugin uses Fluentd event tag for InfluxDB series.
@@ -54,6 +56,7 @@ So if you have events with `app.event`, influxdb plugin inserts events into `app
54
56
  password mypwd
55
57
  use_ssl false
56
58
  time_precision s
59
+ tag_keys ['key1', 'key2']
57
60
  </match>
58
61
  ```
59
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.0'
6
+ s.version = '0.2.1'
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}
@@ -14,6 +14,7 @@ class Fluent::InfluxdbOutput < Fluent::BufferedOutput
14
14
  config_param :password, :string, :default => 'root', :secret => true
15
15
  config_param :time_precision, :string, :default => 's'
16
16
  config_param :use_ssl, :bool, :default => false
17
+ config_param :tag_keys, :array, :default => []
17
18
 
18
19
 
19
20
  def initialize
@@ -51,7 +52,12 @@ class Fluent::InfluxdbOutput < Fluent::BufferedOutput
51
52
  point = {}
52
53
  point[:timestamp] = record.delete('time') || time
53
54
  point[:series] = tag
54
- point[:values] = record
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
55
61
  points << point
56
62
  end
57
63
  end
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.0
4
+ version: 0.2.1
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-27 00:00:00.000000000 Z
12
+ date: 2015-07-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd