fluent-plugin-couch 0.1.0 → 0.1.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.
@@ -1,5 +1,8 @@
1
1
  = CouchDB output plugin for Fluent
2
2
 
3
+ == Install
4
+ $ gem install fluent-plugin-couch
5
+
3
6
  == Component
4
7
 
5
8
  === CouchDBOutput
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -1,3 +1,4 @@
1
+
1
2
  module Couch
2
3
  require 'net/http'
3
4
  class Server
@@ -40,6 +41,12 @@ end
40
41
  module Fluent
41
42
  class CouchOutput < BufferedOutput
42
43
  Fluent::Plugin.register_output('couch', self)
44
+
45
+ config_param :database, :string => nil do |val|
46
+ '/'+val
47
+ end
48
+ config_param :host, :string, :default => 'localhost'
49
+ config_param :port, :string, :default => '5984'
43
50
 
44
51
  def initialize
45
52
  super
@@ -48,16 +55,15 @@ module Fluent
48
55
 
49
56
  def configure(conf)
50
57
  super
51
- @database_name = '/'+conf['database'] if conf.has_key?('database')
52
- raise ConfigError, "'database' parameter is required on couch output" if @database_name.nil?
53
- @host = conf['host'] || 'localhost'
54
- @port = conf['port'] || '5984'
55
58
  end
56
59
 
57
60
  def start
58
61
  super
62
+ p @database
63
+ p @host
64
+ p @port
59
65
  @couch = Couch::Server.new(@host, @port)
60
- @couch.put(@database_name, "")
66
+ @couch.put(@database, "")
61
67
  end
62
68
 
63
69
  def shutdown
@@ -79,7 +85,7 @@ module Fluent
79
85
  }
80
86
  #TODO: bulk insert
81
87
  for record in records
82
- @couch.post(@database_name,record.to_json)
88
+ @couch.post(@database,record.to_json)
83
89
  end
84
90
  end
85
91
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-couch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-10-16 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
16
- requirement: &70361836939780 !ruby/object:Gem::Requirement
16
+ requirement: &70301598210360 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 0.10.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70361836939780
24
+ version_requirements: *70301598210360
25
25
  description:
26
26
  email: ixixizko@gmail.com
27
27
  executables: []