fluent-plugin-mqtt-io 0.0.2 → 0.0.3
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/README.md +2 -1
- data/fluent-plugin-mqtt-io.gemspec +1 -1
- data/lib/fluent/plugin/mqtt_output_mixin.rb +9 -1
- data/lib/fluent/plugin/out_mqtt.rb +1 -1
- data/lib/fluent/plugin/out_mqtt_buf.rb +1 -1
- 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: a101da6ec1e37ea4d06abcdb86de0d197e9b3a61
|
4
|
+
data.tar.gz: 133378382d856ed7a71fed8d2ebb45da077d7091
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4257209a7c1dc3f66632c25cab3467c565bac14676d274fbc78430f1f8b9790c4c4e33777383ba489537ac20dccd085639b621483fe8391224a564c20cdc2233
|
7
|
+
data.tar.gz: 2704c441daa69f016a2486dffd3b70947b0e0077d5eb3fc45c36f62076acbafc3d2586c3c065d8fa93a8dba2986541e3c31a1fa6df24ed5f06be4d58ba5d1f40
|
data/README.md
CHANGED
@@ -68,7 +68,8 @@ Output Plugin can be used via match directive.
|
|
68
68
|
|
69
69
|
The options are basically the same as Input Plugin. The difference is the following.
|
70
70
|
|
71
|
-
- time_key: An attribute name used for timestamp field. Default is
|
71
|
+
- time_key: An attribute name used for timestamp field genarated from fluentd time field. Default is nil (omitted).
|
72
|
+
If this option is omitted, timestamp field is not appended to the output record.
|
72
73
|
- time_format: Output format of timestamp field. Default is ISO8601. You can specify your own format by using TimeParser.
|
73
74
|
- topic_rewrite_pattern: Regexp pattern to extract replacement words from received topic or tag name
|
74
75
|
- topic_rewrite_replacement: Topic name used for the publish using extracted pattern
|
@@ -12,7 +12,7 @@ module Fluent
|
|
12
12
|
base.config_param :ca_file, :string, :default => nil
|
13
13
|
base.config_param :key_file, :string, :default => nil
|
14
14
|
base.config_param :cert_file, :string, :default => nil
|
15
|
-
base.config_param :time_key, :string, :default =>
|
15
|
+
base.config_param :time_key, :string, :default => nil
|
16
16
|
base.config_param :time_format, :string, :default => nil
|
17
17
|
base.config_param :topic_rewrite_pattern, :string, :default => nil
|
18
18
|
base.config_param :topic_rewrite_replacement, :string, :default => nil
|
@@ -72,6 +72,14 @@ module Fluent
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
+
def timestamp_hash(time)
|
76
|
+
if @time_key.nil?
|
77
|
+
{}
|
78
|
+
else
|
79
|
+
{@time_key => format_time(time)}
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
75
83
|
def rewrite_tag(tag)
|
76
84
|
if @topic_rewrite_pattern.nil?
|
77
85
|
tag.gsub("\.", "/")
|
@@ -10,7 +10,7 @@ module Fluent
|
|
10
10
|
def emit(tag, es, chain)
|
11
11
|
es.each {|time,record|
|
12
12
|
$log.debug "#{tag}, #{format_time(time)}, #{record}"
|
13
|
-
@connect.publish(rewrite_tag(tag), record.merge(
|
13
|
+
@connect.publish(rewrite_tag(tag), record.merge(timestamp_hash(time)).to_json)
|
14
14
|
}
|
15
15
|
$log.flush
|
16
16
|
|
@@ -23,7 +23,7 @@ module Fluent
|
|
23
23
|
def write(chunk)
|
24
24
|
json = json_parse(chunk.read)
|
25
25
|
$log.debug "#{json[0]}, #{format_time(json[1])}, #{json[2]}"
|
26
|
-
@connect.publish(rewrite_tag(json[0]), (json[2].merge(
|
26
|
+
@connect.publish(rewrite_tag(json[0]), (json[2].merge(timestamp_hash(json[1]))).to_json)
|
27
27
|
$log.flush
|
28
28
|
end
|
29
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-mqtt-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toyokazu Akiyama
|
8
8
|
autorequire:
|
9
9
|
bindir: []
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|