fluent-plugin-concat 0.6.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/fluent-plugin-concat.gemspec +1 -1
- data/lib/fluent/plugin/filter_concat.rb +38 -15
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95f8097d8136f9936c1461ab176f2383888ed4e2
|
4
|
+
data.tar.gz: e29e68448603bb9cbdc5754d3b9709afc58839b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fa4386e2addaaa1a3350def2c5c9b4d9a2deed83139f2b62f139290a8197cd12ce8d1323772650c39a0a57ccba081c6edd3207cfc8af50084e95588d7e58e51
|
7
|
+
data.tar.gz: b6207ff66e35becee6f006388fafbed69c043711bbfc7215b025496e49a9e4c2444661fb5631c5591b1d9af63f2a92cb07c5851aeaa390396f899fe2ba24c815
|
data/.rubocop.yml
CHANGED
@@ -76,10 +76,12 @@ module Fluent
|
|
76
76
|
new_es = MultiEventStream.new
|
77
77
|
es.each do |time, record|
|
78
78
|
begin
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
79
|
+
flushed_es = process(tag, time, record)
|
80
|
+
unless flushed_es.empty?
|
81
|
+
flushed_es.each do |_time, new_record|
|
82
|
+
time = _time if @use_first_timestamp
|
83
|
+
new_es.add(time, record.merge(new_record))
|
84
|
+
end
|
83
85
|
end
|
84
86
|
rescue => e
|
85
87
|
router.emit_error_event(tag, time, record, e)
|
@@ -97,6 +99,7 @@ module Fluent
|
|
97
99
|
end
|
98
100
|
|
99
101
|
def process(tag, time, record)
|
102
|
+
new_es = MultiEventStream.new
|
100
103
|
if @stream_identity_key
|
101
104
|
stream_identity = "#{tag}:#{record[@stream_identity_key]}"
|
102
105
|
else
|
@@ -107,30 +110,49 @@ module Fluent
|
|
107
110
|
when :line
|
108
111
|
@buffer[stream_identity] << [tag, time, record]
|
109
112
|
if @buffer[stream_identity].size >= @n_lines
|
110
|
-
|
113
|
+
new_time, new_record = flush_buffer(stream_identity)
|
114
|
+
time = new_time if @use_first_timestamp
|
115
|
+
new_es.add(time, new_record)
|
116
|
+
return new_es
|
111
117
|
end
|
112
118
|
when :regexp
|
113
|
-
|
119
|
+
case
|
120
|
+
when firstline?(record[@key])
|
114
121
|
if @buffer[stream_identity].empty?
|
115
122
|
@buffer[stream_identity] << [tag, time, record]
|
123
|
+
if lastline?(record[@key])
|
124
|
+
new_time, new_record = flush_buffer(stream_identity)
|
125
|
+
time = new_time if @use_first_timestamp
|
126
|
+
new_es.add(time, new_record)
|
127
|
+
end
|
116
128
|
else
|
117
|
-
|
129
|
+
new_time, new_record = flush_buffer(stream_identity, [tag, time, record])
|
130
|
+
time = new_time if @use_first_timestamp
|
131
|
+
new_es.add(time, new_record)
|
132
|
+
if lastline?(record[@key])
|
133
|
+
new_time, new_record = flush_buffer(stream_identity)
|
134
|
+
time = new_time if @use_first_timestamp
|
135
|
+
new_es.add(time, new_record)
|
136
|
+
end
|
137
|
+
return new_es
|
118
138
|
end
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
139
|
+
when lastline?(record[@key])
|
140
|
+
@buffer[stream_identity] << [tag, time, record]
|
141
|
+
new_time, new_record = flush_buffer(stream_identity)
|
142
|
+
time = new_time if @use_first_timestamp
|
143
|
+
new_es.add(time, new_record)
|
144
|
+
return new_es
|
145
|
+
else
|
125
146
|
if @buffer[stream_identity].empty?
|
126
|
-
|
147
|
+
new_es.add(time, record)
|
148
|
+
return new_es
|
127
149
|
else
|
128
150
|
# Continuation of the previous line
|
129
151
|
@buffer[stream_identity] << [tag, time, record]
|
130
152
|
end
|
131
153
|
end
|
132
154
|
end
|
133
|
-
|
155
|
+
new_es
|
134
156
|
end
|
135
157
|
|
136
158
|
def firstline?(text)
|
@@ -157,6 +179,7 @@ module Fluent
|
|
157
179
|
timeout_stream_identities = []
|
158
180
|
@timeout_map.each do |stream_identity, previous_timestamp|
|
159
181
|
next if @flush_interval > (now - previous_timestamp)
|
182
|
+
next if @buffer[stream_identity].empty?
|
160
183
|
time, flushed_record = flush_buffer(stream_identity)
|
161
184
|
timeout_stream_identities << stream_identity
|
162
185
|
tag = stream_identity.split(":").first
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-concat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenji Okimoto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
141
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.
|
142
|
+
rubygems_version: 2.5.1
|
143
143
|
signing_key:
|
144
144
|
specification_version: 4
|
145
145
|
summary: Fluentd Filter plugin to concat multiple event messages
|