fluent-plugin-splunkapi 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = "fluent-plugin-splunkapi"
6
- gem.version = "0.1.1"
6
+ gem.version = "0.1.2"
7
7
  gem.authors = ["Keisuke Nishida"]
8
8
  gem.email = ["knishida@bizmobile.co.jp"]
9
9
  gem.description = %q{Splunk output plugin for Fluent event collector}
@@ -47,6 +47,9 @@ class SplunkAPIOutput < BufferedOutput
47
47
  config_param :time_format, :string, :default => 'localtime'
48
48
  config_param :format, :string, :default => 'json'
49
49
 
50
+ config_param :post_retry_max, :integer, :default => 5
51
+ config_param :post_retry_interval, :integer, :default => 5
52
+
50
53
  def initialize
51
54
  super
52
55
  require 'net/http/persistent'
@@ -155,8 +158,16 @@ class SplunkAPIOutput < BufferedOutput
155
158
  post.basic_auth @username, @password
156
159
  post.body = messages.join('')
157
160
  $log.debug "POST #{uri}"
158
- response = @http.request uri, post
159
- $log.error response.message if response.code != "200"
161
+ # retry up to :post_retry_max times
162
+ 1.upto(@post_retry_max) do |c|
163
+ response = @http.request uri, post
164
+ break if response.code != "503"
165
+ $log.debug "=> #{response.code} (#{response.message})"
166
+ sleep @post_retry_interval
167
+ # fluentd will retry processing on exception
168
+ # FIXME: this may duplicate logs with multiple buffers
169
+ raise "#{uri}: #{response.message}" if c == @post_retry_max
170
+ end
160
171
  end
161
172
  end
162
173
  end
metadata CHANGED
@@ -1,87 +1,80 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-splunkapi
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.1
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 2
9
+ version: 0.1.2
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Keisuke Nishida
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2013-01-24 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
16
+
17
+ date: 2013-02-02 00:00:00 +09:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: fluentd
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :development
23
22
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
- - !ruby/object:Gem::Dependency
31
- name: net-http-persistent
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ version: "0"
38
30
  type: :development
31
+ version_requirements: *id001
32
+ - !ruby/object:Gem::Dependency
33
+ name: net-http-persistent
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
46
- - !ruby/object:Gem::Dependency
35
+ requirement: &id002 !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ segments:
40
+ - 0
41
+ version: "0"
42
+ type: :development
43
+ version_requirements: *id002
44
+ - !ruby/object:Gem::Dependency
47
45
  name: fluentd
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
- type: :runtime
55
46
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- - !ruby/object:Gem::Dependency
63
- name: net-http-persistent
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
47
+ requirement: &id003 !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ segments:
52
+ - 0
53
+ version: "0"
70
54
  type: :runtime
55
+ version_requirements: *id003
56
+ - !ruby/object:Gem::Dependency
57
+ name: net-http-persistent
71
58
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
59
+ requirement: &id004 !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ segments:
64
+ - 0
65
+ version: "0"
66
+ type: :runtime
67
+ version_requirements: *id004
78
68
  description: Splunk output plugin for Fluent event collector
79
- email:
69
+ email:
80
70
  - knishida@bizmobile.co.jp
81
71
  executables: []
72
+
82
73
  extensions: []
74
+
83
75
  extra_rdoc_files: []
84
- files:
76
+
77
+ files:
85
78
  - .gitignore
86
79
  - Gemfile
87
80
  - LICENSE.txt
@@ -91,30 +84,36 @@ files:
91
84
  - lib/fluent/plugin/out_splunkapi.rb
92
85
  - test/helper.rb
93
86
  - test/plugin/test_out_splunkapi.rb
94
- homepage: ''
87
+ has_rdoc: true
88
+ homepage: ""
95
89
  licenses: []
90
+
96
91
  post_install_message:
97
92
  rdoc_options: []
98
- require_paths:
93
+
94
+ require_paths:
99
95
  - lib
100
- required_ruby_version: !ruby/object:Gem::Requirement
101
- none: false
102
- requirements:
103
- - - ! '>='
104
- - !ruby/object:Gem::Version
105
- version: '0'
106
- required_rubygems_version: !ruby/object:Gem::Requirement
107
- none: false
108
- requirements:
109
- - - ! '>='
110
- - !ruby/object:Gem::Version
111
- version: '0'
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ segments:
101
+ - 0
102
+ version: "0"
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ segments:
108
+ - 0
109
+ version: "0"
112
110
  requirements: []
111
+
113
112
  rubyforge_project: fluent-plugin-splunkapi
114
- rubygems_version: 1.8.23
113
+ rubygems_version: 1.3.6
115
114
  signing_key:
116
115
  specification_version: 3
117
116
  summary: Splunk output plugin for Fluent event collector
118
- test_files:
117
+ test_files:
119
118
  - test/helper.rb
120
119
  - test/plugin/test_out_splunkapi.rb