fluent-plugin-label-router 0.2.2 → 0.2.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/fluent-plugin-label-router.gemspec +1 -1
- data/lib/fluent/plugin/out_label_router.rb +16 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd6b78faaf79aa156a111780a7dde808623edb45059e75412e839a8f899121ff
|
4
|
+
data.tar.gz: 52498b7e26d5d3d9d69edb4c2dc4ae497729c73785ba07b4ffbad474e6ae96ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d89cca1fad117cea4b1a40fbf31ff54d811562165929ba9c1603e40923f694221e2407262c24b867d11edf6d6d9ef452446fbb51d72da63aede210016d3b5a87
|
7
|
+
data.tar.gz: 91aa7edd22925ecdae9f05cf1fc1f8f0e7e9fb5cf89b15437db50269112aaf1d44738bde764acb60d3840c9b36566fc819e99d9fff366ed180019711bc2847af
|
@@ -122,13 +122,15 @@ module Fluent
|
|
122
122
|
|
123
123
|
def process(tag, es)
|
124
124
|
if @sticky_tags
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
125
|
+
@mutex.synchronize {
|
126
|
+
if @route_map.has_key?(tag)
|
127
|
+
# We already matched with this tag send events to the routers
|
128
|
+
@route_map[tag].each do |r|
|
129
|
+
r.emit_es(tag, es.dup)
|
130
|
+
end
|
131
|
+
return
|
129
132
|
end
|
130
|
-
|
131
|
-
end
|
133
|
+
}
|
132
134
|
end
|
133
135
|
event_stream = Hash.new {|h, k| h[k] = Fluent::MultiEventStream.new }
|
134
136
|
es.each do |time, record|
|
@@ -141,7 +143,9 @@ module Fluent
|
|
141
143
|
if r.match?(input_metadata)
|
142
144
|
orphan_record = false
|
143
145
|
if @sticky_tags
|
144
|
-
@
|
146
|
+
@mutex.synchronize {
|
147
|
+
@route_map[tag].add(r)
|
148
|
+
}
|
145
149
|
end
|
146
150
|
if @batch
|
147
151
|
event_stream[r].add(time, record)
|
@@ -152,7 +156,9 @@ module Fluent
|
|
152
156
|
end
|
153
157
|
if !@default_router.nil? && orphan_record
|
154
158
|
if @sticky_tags
|
155
|
-
@
|
159
|
+
@mutex.synchronize {
|
160
|
+
@route_map[tag].add(@default_router)
|
161
|
+
}
|
156
162
|
end
|
157
163
|
if @batch
|
158
164
|
event_stream[@default_router].add(time, record)
|
@@ -170,7 +176,8 @@ module Fluent
|
|
170
176
|
|
171
177
|
def configure(conf)
|
172
178
|
super
|
173
|
-
@route_map = Hash.new { |h, k| h[k] =
|
179
|
+
@route_map = Hash.new { |h, k| h[k] = Set.new }
|
180
|
+
@mutex = Mutex.new
|
174
181
|
@routers = []
|
175
182
|
@default_router = nil
|
176
183
|
@routes.each do |rule|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-label-router
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Banzai Cloud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|