logstash-input-google_pubsub_compressed_batches 1.2.5 → 1.2.6
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.
Potentially problematic release.
This version of logstash-input-google_pubsub_compressed_batches might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/lib/logstash/inputs/google_pubsub.rb +18 -3
- data/logstash-input-google_pubsub_compressed_batches.gemspec +1 -1
- 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: 0f5214fad7a25763f2f63aa0b18fd32b7af81cab156cb104a68d4c37da5af471
|
4
|
+
data.tar.gz: 4134da7ea97087725a404cb24939041d7e881a5537a8f019e056882080e238bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c62b860f7bbf8845e648f3a2b24a964bf44a65ff1ee1a7c17e7c7462e2c78a26301bdf8bbffb1ef9129bd95373f285809b8a5e3bcead7ceed03b020a03ad021a
|
7
|
+
data.tar.gz: 4525ad91b4e5ed78f5f273995047655a25bd56d5587fe463e61b5a8e464c42db99341164d3eea0bd3708f5b4d9deaca1bc7cd74a666d74440a118ef15a56e855
|
data/CHANGELOG.md
CHANGED
@@ -252,11 +252,11 @@ class LogStash::Inputs::GooglePubSub < LogStash::Inputs::Base
|
|
252
252
|
@logger.debug("Pulling messages from sub '#{@subscription_id}'")
|
253
253
|
handler = MessageReceiver.new do |message|
|
254
254
|
# handle incoming message, then ack/nack the received message
|
255
|
-
data = message.getData().toStringUtf8()
|
256
255
|
algorithm = message.getAttributesMap()["compression_algorithm"]
|
257
256
|
|
258
257
|
case algorithm
|
259
258
|
when nil
|
259
|
+
data = message.getData().toStringUtf8()
|
260
260
|
@codec.decode(data) do |event|
|
261
261
|
event.set("host", event.get("host") || @host)
|
262
262
|
event.set("[@metadata][pubsub_message]", extract_metadata(message)) if @include_metadata
|
@@ -264,9 +264,24 @@ class LogStash::Inputs::GooglePubSub < LogStash::Inputs::Base
|
|
264
264
|
queue << event
|
265
265
|
end
|
266
266
|
when COMPRESSION_ALGORITHM_ZLIB
|
267
|
-
|
267
|
+
data = message.getData().toByteArray()
|
268
|
+
|
269
|
+
# decompress batch
|
270
|
+
bais = java.io.ByteArrayInputStream.new(data)
|
271
|
+
iis = java.util.zip.InflaterInputStream.new(bais)
|
272
|
+
|
273
|
+
result = ""
|
274
|
+
buf = Java::byte[5].new
|
275
|
+
rlen = -1
|
276
|
+
|
277
|
+
while (rlen = iis.read(buf)) != -1 do
|
278
|
+
result += java.lang.String.new(java.util.Arrays.copyOf(buf, rlen), "UTF-8")
|
279
|
+
end
|
280
|
+
|
281
|
+
# split into multiple events
|
282
|
+
lines = result.split(BATCHED_RECORD_SEPARATOR)
|
268
283
|
lines.each do |line|
|
269
|
-
event = LogStash::Event.new(line)
|
284
|
+
event = LogStash::Event.new("message" => line)
|
270
285
|
event.set("host", event.get("host") || @host)
|
271
286
|
event.set("[@metadata][pubsub_message]", extract_metadata(message)) if @include_metadata
|
272
287
|
decorate(event)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-input-google_pubsub_compressed_batches'
|
3
|
-
s.version = '1.2.
|
3
|
+
s.version = '1.2.6'
|
4
4
|
s.licenses = ['Apache-2.0']
|
5
5
|
s.summary = "Consume events from a Google Cloud PubSub service. Supports zlib compressed batches"
|
6
6
|
s.description = "This gem is a Logstash input plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program."
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-google_pubsub_compressed_batches
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Johnson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-01-
|
12
|
+
date: 2021-01-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|