Sha256: 2dd27384b122173914b578ac13c81fcc433d877e62c4154c17a155a3caf6081a
Contents?: true
Size: 506 Bytes
Versions: 6
Compression:
Stored size: 506 Bytes
Contents
require 'base64' require 'json' require 'stringio' require 'zlib' module Jets::Job::Helpers module LogEvent def log_event encoded = event["awslogs"]["data"] compressed_string = Base64.decode64(encoded) gz = Zlib::GzipReader.new(StringIO.new(compressed_string)) uncompressed_string = gz.read data = JSON.load(uncompressed_string) ActiveSupport::HashWithIndifferentAccess.new(data) end def log_event? !!event.dig("awslogs", "data") end end end
Version data entries
6 entries across 6 versions & 1 rubygems