fluent-plugin-logzio 0.0.9 → 0.0.10
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-logzio.gemspec +1 -1
- data/lib/fluent/plugin/out_logzio.rb +4 -4
- data/lib/fluent/plugin/out_logzio_buffered.rb +9 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a82cd7629b087d3e44e7ca9d0a04df913e6439db
|
4
|
+
data.tar.gz: 3e6fbfbae0f48eb296ac18de3c74881b52c1c56b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff655a47646a4dbe73034981e5919bf9705c7853b38e64a816374448fef3f5589bb1cd8e90faf38bee4a6fbb57f112313708dd86a7d45cacd4ff4e38a1e35896
|
7
|
+
data.tar.gz: d967ec4a019d7f4bc792b722cb9109b8a94dd5ed381d330e255387b4ee6e9de7c17266a1fa8c7ab35397ad243ae889fcfb5dcdefa318662451c434f5eb2fc0c1
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = 'fluent-plugin-logzio'
|
7
|
-
s.version = '0.0.
|
7
|
+
s.version = '0.0.10'
|
8
8
|
s.authors = ['Yury Kotov', 'Roi Rav-Hon']
|
9
9
|
s.email = ['bairkan@gmail.com', 'roi@logz.io']
|
10
10
|
s.homepage = 'https://github.com/logzio/fluent-plugin-logzio'
|
@@ -24,15 +24,15 @@ module Fluent
|
|
24
24
|
chain.next
|
25
25
|
es.each {|time,record|
|
26
26
|
record_json = Yajl.dump(record)
|
27
|
-
|
27
|
+
log.debug "Record sent #{record_json}"
|
28
28
|
post = Net::HTTP::Post.new @uri.request_uri
|
29
29
|
post.body = record_json
|
30
30
|
begin
|
31
31
|
response = @http.request @uri, post
|
32
|
-
|
33
|
-
|
32
|
+
log.debug "HTTP Response code #{response.code}"
|
33
|
+
log.error response.body if response.code != '200'
|
34
34
|
rescue StandardError
|
35
|
-
|
35
|
+
log.error "Error connecting to logzio verify the url #{@endpoint_url}"
|
36
36
|
end
|
37
37
|
}
|
38
38
|
end
|
@@ -25,7 +25,7 @@ module Fluent
|
|
25
25
|
@http.headers['Content-Type'] = 'text/plain'
|
26
26
|
@http.idle_timeout = @http_idle_timeout
|
27
27
|
@http.socket_options << [Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, 1]
|
28
|
-
|
28
|
+
log.debug "Started logzio shipper.."
|
29
29
|
end
|
30
30
|
|
31
31
|
def shutdown
|
@@ -45,7 +45,7 @@ module Fluent
|
|
45
45
|
records.push(Yajl.dump(record))
|
46
46
|
}
|
47
47
|
|
48
|
-
|
48
|
+
log.debug "Got flush timeout, containing #{records.length} chunks"
|
49
49
|
|
50
50
|
# Setting our request
|
51
51
|
post = Net::HTTP::Post.new @uri.request_uri
|
@@ -59,12 +59,12 @@ module Fluent
|
|
59
59
|
|
60
60
|
if response.code != '200'
|
61
61
|
if response.code == '401'
|
62
|
-
|
62
|
+
log.error("You are not authorized with Logz.io! Token OK? dropping logs...")
|
63
63
|
should_retry = false
|
64
64
|
end
|
65
65
|
|
66
66
|
if response.code == '400'
|
67
|
-
|
67
|
+
log.info("Got 400 code from Logz.io. This means that some of your logs are too big, or badly formatted. Response: #{response.body}")
|
68
68
|
should_retry = false
|
69
69
|
end
|
70
70
|
|
@@ -72,9 +72,9 @@ module Fluent
|
|
72
72
|
sleep_interval = 2
|
73
73
|
|
74
74
|
if should_retry
|
75
|
-
|
75
|
+
log.debug "Got HTTP #{response.code} from logz.io, not giving up just yet"
|
76
76
|
@retry_count.times do |counter|
|
77
|
-
|
77
|
+
log.debug "Sleeping for #{sleep_interval} seconds, and trying again."
|
78
78
|
sleep(sleep_interval)
|
79
79
|
|
80
80
|
# Retry
|
@@ -82,21 +82,21 @@ module Fluent
|
|
82
82
|
|
83
83
|
# Sucecss, no further action is needed
|
84
84
|
if response.code == 200
|
85
|
-
|
85
|
+
log.debug "Successfuly sent the failed bulk."
|
86
86
|
break
|
87
87
|
else
|
88
88
|
# Doubling the sleep interval
|
89
89
|
sleep_interval *= 2
|
90
90
|
|
91
91
|
if counter == @retry_count - 1
|
92
|
-
|
92
|
+
log.error "Could not send your bulk after 3 tries. Sorry. Got HTTP #{response.code} with body: #{response.body}"
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
96
96
|
end
|
97
97
|
end
|
98
98
|
rescue StandardError => error
|
99
|
-
|
99
|
+
log.error "Error connecting to logzio. Got exception: #{error}"
|
100
100
|
end
|
101
101
|
end
|
102
102
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-logzio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yury Kotov
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-04-
|
12
|
+
date: 2017-04-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: net-http-persistent
|