fluent-plugin-logzio 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -8
- data/fluent-plugin-logzio.gemspec +1 -1
- metadata +2 -3
- data/lib/fluent/plugin/out_logzio.rb +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb60223d1da3b7dcbb52f07e9094c2d62e4eef64
|
4
|
+
data.tar.gz: 61edf950ff5231802cd82615207cf3d5f43bdf63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9e3307a7108db15a6ed7f66171993580fcac951716a1f559b0495a2377a132c635cc78400e2c1f74843a92fad3f62cc6acb70a579706d95a0a84df379796b9e
|
7
|
+
data.tar.gz: 5d1bbc1043da77fd3642e620c0490727c27d4d0546c64af633d2c87393772b5c4ac13195d37596bda3c214f790c3a124d4aa46a2fd3c644b0cf846b9367c98a7
|
data/README.md
CHANGED
@@ -24,17 +24,14 @@ With fluent-plugin-logzio you will be able to use [Logz.io](http://logz.io) as o
|
|
24
24
|
</match>
|
25
25
|
```
|
26
26
|
|
27
|
-
If you absolutly must, use the non-buffered plugin (we really recommend using the buffered)
|
28
|
-
```
|
29
|
-
<match your_match>
|
30
|
-
@type logzio
|
31
|
-
endpoint_url http://listener.logz.io:8090?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
32
|
-
</match>
|
33
|
-
```
|
34
|
-
|
35
27
|
## Parameters
|
36
28
|
* **endpoint_url** the url to Logz.io input where `xxx-xxxx...` is your Logz.io access token, and `my_type` is the type of your logs in logz.io
|
37
29
|
* **output_include_time** should the appender add a timestamp to your logs on their process time. (recommended)
|
38
30
|
* **output_include_tags** should the appender add the fluentd tag to the document, called "fluentd_tag" (which can be renamed, see next point)
|
39
31
|
* **output_tags_fieldname** set the tag's fieldname, defaults to "fluentd_tag"
|
40
32
|
* **http_idle_timeout** timeout in seconds that the http persistent connection will stay open without traffic
|
33
|
+
|
34
|
+
|
35
|
+
## Release Notes
|
36
|
+
- 0.0.13: BREAKING - Removed non-buffered version. It's really not efficient, and should just not be used. If you are using this version, you should change to the buffered one.
|
37
|
+
- 0.0.12: Catch exception when parsing YAML to ignore (instead of crash) not valid logs
|
@@ -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.13'
|
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'
|
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.13
|
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-
|
12
|
+
date: 2017-08-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: net-http-persistent
|
@@ -110,7 +110,6 @@ files:
|
|
110
110
|
- README.md
|
111
111
|
- Rakefile
|
112
112
|
- fluent-plugin-logzio.gemspec
|
113
|
-
- lib/fluent/plugin/out_logzio.rb
|
114
113
|
- lib/fluent/plugin/out_logzio_buffered.rb
|
115
114
|
- spec/lib/fluent/plugin/out_logzio_buffered_spec.rb
|
116
115
|
- spec/lib/fluent/plugin/out_logzio_spec.rb
|
@@ -1,45 +0,0 @@
|
|
1
|
-
module Fluent
|
2
|
-
class LogzioOutput < Fluent::Output
|
3
|
-
Fluent::Plugin.register_output('logzio', self)
|
4
|
-
config_param :endpoint_url, :string, default: nil
|
5
|
-
config_param :output_include_time, :bool, default: true
|
6
|
-
config_param :output_include_tags, :bool, default: true
|
7
|
-
config_param :output_tags_fieldname, :string, default: 'fluentd_tags'
|
8
|
-
|
9
|
-
def configure(conf)
|
10
|
-
super
|
11
|
-
$log.debug "Logzio url #{@endpoint_url}"
|
12
|
-
end
|
13
|
-
|
14
|
-
def start
|
15
|
-
super
|
16
|
-
require 'net/http/persistent'
|
17
|
-
@uri = URI @endpoint_url
|
18
|
-
@http = Net::HTTP::Persistent.new 'fluent-plugin-logzio', :ENV
|
19
|
-
@http.headers['Content-Type'] = 'application/json'
|
20
|
-
end
|
21
|
-
|
22
|
-
def shutdown
|
23
|
-
super
|
24
|
-
end
|
25
|
-
|
26
|
-
def emit(tag, es, chain)
|
27
|
-
chain.next
|
28
|
-
es.each {|time,record|
|
29
|
-
record['@timestamp'] ||= Time.at(time).iso8601(3) if @output_include_time
|
30
|
-
record[@output_tags_fieldname] ||= tag.to_s if @output_include_tags
|
31
|
-
record_json = Yajl.dump(record)
|
32
|
-
log.debug "Record sent #{record_json}"
|
33
|
-
post = Net::HTTP::Post.new @uri.request_uri
|
34
|
-
post.body = record_json
|
35
|
-
begin
|
36
|
-
response = @http.request @uri, post
|
37
|
-
log.debug "HTTP Response code #{response.code}"
|
38
|
-
log.error response.body if response.code != '200'
|
39
|
-
rescue StandardError
|
40
|
-
log.error "Error connecting to logzio verify the url #{@endpoint_url}"
|
41
|
-
end
|
42
|
-
}
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|