fluent-plugin-rds-slowlog 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,10 +4,5 @@ rvm:
4
4
  - 1.9.2
5
5
  - 1.9.3
6
6
  - 2.0.0
7
- - rbx-19mode
8
-
9
- branches:
10
- only:
11
- - master
12
7
 
13
8
  script: bundle exec rake test
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "fluent-plugin-rds-slowlog"
7
- gem.version = "0.0.4"
7
+ gem.version = "0.0.5"
8
8
  gem.authors = ["kenjiskywalker"]
9
9
  gem.email = ["git@kenjiskywalker.org"]
10
10
  gem.description = "Amazon RDS slow_log input plugin for Fluent event collector"
@@ -1,13 +1,18 @@
1
1
  class Fluent::Rds_SlowlogInput < Fluent::Input
2
2
  Fluent::Plugin.register_input("rds_slowlog", self)
3
3
 
4
+ # To support log_level option implemented by Fluentd v0.10.43
5
+ unless method_defined?(:log)
6
+ define_method("log") { $log }
7
+ end
8
+
4
9
  config_param :tag, :string
5
10
  config_param :host, :string, :default => nil
6
11
  config_param :port, :integer, :default => 3306
7
12
  config_param :username, :string, :default => nil
8
13
  config_param :password, :string, :default => nil
9
14
 
10
- def initialize
15
+ def initialize
11
16
  super
12
17
  require 'mysql2'
13
18
  end
@@ -23,7 +28,7 @@ class Fluent::Rds_SlowlogInput < Fluent::Input
23
28
  :database => 'mysql'
24
29
  })
25
30
  rescue
26
- $log.error "fluent-plugin-rds-slowlog: cannot connect RDS"
31
+ log.error "fluent-plugin-rds-slowlog: cannot connect RDS"
27
32
  end
28
33
  end
29
34
 
@@ -51,6 +56,7 @@ class Fluent::Rds_SlowlogInput < Fluent::Input
51
56
  slow_log_data = @client.query('SELECT * FROM slow_log', :cast => false)
52
57
 
53
58
  slow_log_data.each do |row|
59
+ row.each_key {|key| row[key].force_encoding(Encoding::ASCII_8BIT) if row[key].is_a?(String)}
54
60
  Fluent::Engine.emit(tag, Fluent::Engine.now, row)
55
61
  end
56
62
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-rds-slowlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-07 00:00:00.000000000 Z
12
+ date: 2014-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
@@ -68,7 +68,6 @@ extra_rdoc_files: []
68
68
  files:
69
69
  - .gitignore
70
70
  - .travis.yml
71
- - '='
72
71
  - Gemfile
73
72
  - LICENSE.txt
74
73
  - README.md
@@ -104,4 +103,3 @@ summary: Amazon RDS slow_log input plugin for Fluent event collector
104
103
  test_files:
105
104
  - test/helper.rb
106
105
  - test/plugin/test_in_rds_slowlog.rb
107
- has_rdoc:
data/= DELETED
File without changes