fluent-plugin-nsq 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/fluent/plugin/in_nsq.rb +2 -1
- data/lib/fluent/plugin/out_nsq.rb +6 -1
- metadata +13 -21
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0ace9d22724c5b2fce49193ab04fbaf6299c825d
|
4
|
+
data.tar.gz: 91f95229b1449267be70e268179b7e7eb29d9bcf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 62219d9a43be4725319ccd327ed133e7c778d10c5b4a30fc13d5cea957f5795569ce3d82f166f64683f445a94585ae84a297e8f01c7d3b5c846aaf0be6903efc
|
7
|
+
data.tar.gz: 946598f7bfbc1df77ffef5b0899c5558500a63d1af29fba23e121a5d3b9c16bd8195e50a9c704a2733b0eed25490cda69b677aa2b891df8a67d294d13fe308cc
|
data/lib/fluent/plugin/in_nsq.rb
CHANGED
@@ -27,6 +27,7 @@ module Fluent
|
|
27
27
|
super
|
28
28
|
require 'cool.io'
|
29
29
|
require 'nsq'
|
30
|
+
require 'yajl'
|
30
31
|
end
|
31
32
|
|
32
33
|
def configure(conf)
|
@@ -66,7 +67,7 @@ module Fluent
|
|
66
67
|
|
67
68
|
def consume_one
|
68
69
|
msg = @consumer.pop
|
69
|
-
record =
|
70
|
+
record = Yajl.load(msg.body.force_encoding('UTF-8'))
|
70
71
|
record_tag = tag_for_record(record)
|
71
72
|
record_time = time_for_record(record, msg)
|
72
73
|
Engine.emit(record_tag, record_time, record)
|
@@ -10,6 +10,7 @@ module Fluent
|
|
10
10
|
def initialize
|
11
11
|
super
|
12
12
|
require 'nsq'
|
13
|
+
require 'yajl'
|
13
14
|
end
|
14
15
|
|
15
16
|
def configure(conf)
|
@@ -48,7 +49,11 @@ module Fluent
|
|
48
49
|
:_ts => time,
|
49
50
|
:'@timestamp' => Time.at(time).to_datetime.to_s # kibana/elasticsearch friendly
|
50
51
|
)
|
51
|
-
|
52
|
+
begin
|
53
|
+
@producer.write(Yajl.dump(tagged_record))
|
54
|
+
rescue => e
|
55
|
+
log.warn("nsq: #{e}")
|
56
|
+
end
|
52
57
|
end
|
53
58
|
end
|
54
59
|
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-nsq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.6
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- lxfontes
|
@@ -10,54 +9,48 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2015-09-07 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: fluentd
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
|
-
- - ~>
|
18
|
+
- - "~>"
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: '0.10'
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
|
-
- - ~>
|
25
|
+
- - "~>"
|
29
26
|
- !ruby/object:Gem::Version
|
30
27
|
version: '0.10'
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: nsq-ruby
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- - ~>
|
32
|
+
- - "~>"
|
37
33
|
- !ruby/object:Gem::Version
|
38
34
|
version: '1.0'
|
39
35
|
type: :runtime
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- - ~>
|
39
|
+
- - "~>"
|
45
40
|
- !ruby/object:Gem::Version
|
46
41
|
version: '1.0'
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
43
|
name: rake
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
|
-
- - ~>
|
46
|
+
- - "~>"
|
53
47
|
- !ruby/object:Gem::Version
|
54
48
|
version: '10'
|
55
49
|
type: :development
|
56
50
|
prerelease: false
|
57
51
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
52
|
requirements:
|
60
|
-
- - ~>
|
53
|
+
- - "~>"
|
61
54
|
- !ruby/object:Gem::Version
|
62
55
|
version: '10'
|
63
56
|
description: NSQ output plugin for Fluentd
|
@@ -77,27 +70,26 @@ files:
|
|
77
70
|
homepage: https://github.com/uken/fluent-plugin-nsq
|
78
71
|
licenses:
|
79
72
|
- MIT
|
73
|
+
metadata: {}
|
80
74
|
post_install_message:
|
81
75
|
rdoc_options: []
|
82
76
|
require_paths:
|
83
77
|
- lib
|
84
78
|
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
-
none: false
|
86
79
|
requirements:
|
87
|
-
- -
|
80
|
+
- - ">="
|
88
81
|
- !ruby/object:Gem::Version
|
89
82
|
version: '0'
|
90
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
-
none: false
|
92
84
|
requirements:
|
93
|
-
- -
|
85
|
+
- - ">="
|
94
86
|
- !ruby/object:Gem::Version
|
95
87
|
version: '0'
|
96
88
|
requirements: []
|
97
89
|
rubyforge_project:
|
98
|
-
rubygems_version:
|
90
|
+
rubygems_version: 2.2.3
|
99
91
|
signing_key:
|
100
|
-
specification_version:
|
92
|
+
specification_version: 4
|
101
93
|
summary: output plugin for fluentd
|
102
94
|
test_files:
|
103
95
|
- test/helper.rb
|