fluent-plugin-jabber 0.1.0 → 0.1.1
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.
- data/README.md +16 -1
- data/fluent-plugin-jabber.gemspec +1 -1
- data/lib/fluent/plugin/out_jabber.rb +18 -0
- metadata +4 -3
data/README.md
CHANGED
@@ -34,7 +34,17 @@ See source for details.
|
|
34
34
|
password pa55w0rd
|
35
35
|
|
36
36
|
# Output target JID. Currently multi user chat only.
|
37
|
-
|
37
|
+
#
|
38
|
+
# NOTE: Group chat could'nt accept nickname that already in used.
|
39
|
+
# It cause "conflict: That nickname is registered by another person" error.
|
40
|
+
# To prevent it, specify unique nickname per plugin definition.
|
41
|
+
room test@conference.localhost/unique_nickname
|
42
|
+
|
43
|
+
format Hello!\n${user.name} # ${user.name} replaced with record['user']['name']
|
44
|
+
|
45
|
+
# Enable detailed log of XMPP4R
|
46
|
+
jabber_debug_log true
|
47
|
+
jabber_warnings_log true
|
38
48
|
</match>
|
39
49
|
|
40
50
|
### Message format
|
@@ -53,6 +63,11 @@ If 'body' field not set, the plugin raises error.
|
|
53
63
|
|
54
64
|
## Changes
|
55
65
|
|
66
|
+
### 0.1.1
|
67
|
+
|
68
|
+
* Fix Encoding::CompatibilityError while parsing XMPP messages caused by default_internal is ASCII_8BIT.
|
69
|
+
* add jabber_debug_log and jabber_warnings_log options.
|
70
|
+
|
56
71
|
### 0.1.0
|
57
72
|
|
58
73
|
* Add license
|
@@ -7,6 +7,16 @@ require 'xmpp4r/muc'
|
|
7
7
|
|
8
8
|
require 'pit'
|
9
9
|
|
10
|
+
# Deal with Fluentd's Encoding.default_internal = 'ASCII_8BIT'.
|
11
|
+
class ::REXML::IOSource
|
12
|
+
alias orig_readline readline
|
13
|
+
def readline(*args)
|
14
|
+
line = orig_readline(*args)
|
15
|
+
line = line.force_encoding(::Encoding::UTF_8) if line.encoding == ::Encoding::ASCII_8BIT
|
16
|
+
line
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
10
20
|
class Fluent::JabberOutput < Fluent::Output
|
11
21
|
Fluent::Plugin.register_output('jabber', self)
|
12
22
|
|
@@ -19,6 +29,11 @@ class Fluent::JabberOutput < Fluent::Output
|
|
19
29
|
|
20
30
|
config_param :format, :string
|
21
31
|
|
32
|
+
# Enable error/warning logs of XMPP4R
|
33
|
+
# This configuration is global
|
34
|
+
config_param :jabber_debug_log, :bool, default: false
|
35
|
+
config_param :jabber_warnings_log, :bool, default: false
|
36
|
+
|
22
37
|
attr_reader :jid
|
23
38
|
attr_reader :password
|
24
39
|
|
@@ -35,6 +50,9 @@ class Fluent::JabberOutput < Fluent::Output
|
|
35
50
|
@jid = user_info['jid']
|
36
51
|
@password = user_info['password']
|
37
52
|
end
|
53
|
+
|
54
|
+
Jabber.debug = true if jabber_debug_log
|
55
|
+
Jabber.warnings = true if jabber_warnings_log
|
38
56
|
end
|
39
57
|
|
40
58
|
def start
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-jabber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-29 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -109,9 +109,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
111
|
rubyforge_project:
|
112
|
-
rubygems_version: 1.8.
|
112
|
+
rubygems_version: 1.8.19
|
113
113
|
signing_key:
|
114
114
|
specification_version: 3
|
115
115
|
summary: Fluentd output plugin for XMPP(Jabber) protocol
|
116
116
|
test_files:
|
117
117
|
- spec/out_jabber_spec.rb
|
118
|
+
has_rdoc:
|