fluent-plugin-out-falcon 0.1.6 → 0.1.7
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/fluent-plugin-out-falcon.gemspec +2 -1
- data/lib/fluent/plugin/out_falcon.rb +6 -4
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cab584d3c257835535128465cb6202b072f51d6c
|
4
|
+
data.tar.gz: c200cd4798c71cd000267d1f8d53c9d37ef625d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab21d5ec12e18bc8d28ac0bb9975fd5b77cb1b983768d24801904853563aecca77c5823b481deb57f9b3c3fc89e3473d515f4244b388fb6df4d5e83377f0529f
|
7
|
+
data.tar.gz: bbb64088ae23cab8548a28878e43e2934b5e63c03962bb56a4d997398fc644c8049ac283e601d57766f0e13d55fe836115c56a62cfed266f6981a7ed95c59c7a
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = "fluent-plugin-out-falcon"
|
5
|
-
gem.version = "0.1.
|
5
|
+
gem.version = "0.1.7"
|
6
6
|
gem.authors = ["tsingakbar"]
|
7
7
|
gem.email = ["yuqing@cmcm.com"]
|
8
8
|
gem.summary = %q{A Fluentd output plugin to send logs to falcon's push API}
|
@@ -17,6 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
|
18
18
|
gem.add_runtime_dependency "yajl-ruby", "~> 1.0"
|
19
19
|
gem.add_runtime_dependency "fluentd", [">= 0.10.0", "< 2"]
|
20
|
+
gem.add_runtime_dependency "net-http-persistent", ">= 2.9.0"
|
20
21
|
gem.add_development_dependency "bundler"
|
21
22
|
gem.add_development_dependency "rake"
|
22
23
|
gem.add_development_dependency "test-unit", ">= 3.1.0"
|
@@ -3,7 +3,7 @@ class Fluent::FalconOutput < Fluent::Output
|
|
3
3
|
|
4
4
|
def initialize
|
5
5
|
super
|
6
|
-
require 'net/http'
|
6
|
+
require 'net/http/persistent'
|
7
7
|
require 'uri'
|
8
8
|
require 'yajl'
|
9
9
|
end
|
@@ -36,10 +36,12 @@ class Fluent::FalconOutput < Fluent::Output
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def start
|
39
|
+
@http = Net::HTTP::Persistent.new "falconclient"
|
39
40
|
super
|
40
41
|
end
|
41
42
|
|
42
43
|
def shutdown
|
44
|
+
@http.shutdown
|
43
45
|
super
|
44
46
|
end
|
45
47
|
|
@@ -60,7 +62,7 @@ class Fluent::FalconOutput < Fluent::Output
|
|
60
62
|
def create_request(tag, time, record)
|
61
63
|
url = format_url(tag, time, record)
|
62
64
|
uri = URI.parse(url)
|
63
|
-
req = Net::HTTP
|
65
|
+
req = Net::HTTP::Post.new(uri.path)
|
64
66
|
set_body(req, tag, time, record)
|
65
67
|
set_header(req, tag, time, record)
|
66
68
|
return req, uri
|
@@ -80,10 +82,10 @@ class Fluent::FalconOutput < Fluent::Output
|
|
80
82
|
req.basic_auth(@username, @password)
|
81
83
|
end
|
82
84
|
@last_request_time = Time.now.to_f
|
83
|
-
res =
|
85
|
+
res = @http.request uri, req
|
84
86
|
rescue => e # rescue all StandardErrors
|
85
87
|
# server didn't respond
|
86
|
-
$log.warn "Net::HTTP
|
88
|
+
$log.warn "Net::HTTP::Post raises exception: #{e.class}, '#{e.message}'"
|
87
89
|
raise e if @raise_on_error
|
88
90
|
else
|
89
91
|
unless res and res.is_a?(Net::HTTPSuccess)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-out-falcon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tsingakbar
|
@@ -44,6 +44,20 @@ dependencies:
|
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '2'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: net-http-persistent
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.9.0
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 2.9.0
|
47
61
|
- !ruby/object:Gem::Dependency
|
48
62
|
name: bundler
|
49
63
|
requirement: !ruby/object:Gem::Requirement
|