Sha256: 9bf3a28c18761a5ee64118d4d59ac654c004bf115be8ed6304ab001d144f1fe6

Contents?: true

Size: 447 Bytes

Versions: 139

Compression:

Stored size: 447 Bytes

Contents

require 'base64'
require 'json'
require 'stringio'
require 'zlib'

module Jets::Job::Helpers
  module LogEventHelper
    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
  end
end

Version data entries

139 entries across 139 versions & 3 rubygems

Version Path
jets-4.0.12 lib/jets/job/helpers/log_event_helper.rb
jets-4.0.11 lib/jets/job/helpers/log_event_helper.rb
jets-5.0.6 lib/jets/job/helpers/log_event_helper.rb
jets-5.0.5 lib/jets/job/helpers/log_event_helper.rb
jets-5.0.4 lib/jets/job/helpers/log_event_helper.rb
jets-5.0.3 lib/jets/job/helpers/log_event_helper.rb
jets-5.0.2 lib/jets/job/helpers/log_event_helper.rb
jets-5.0.1 lib/jets/job/helpers/log_event_helper.rb
jets-5.0.0 lib/jets/job/helpers/log_event_helper.rb
jets-4.0.10 lib/jets/job/helpers/log_event_helper.rb
jets-5.0.0.beta1 lib/jets/job/helpers/log_event_helper.rb
jets-4.0.9 lib/jets/job/helpers/log_event_helper.rb
jets-4.0.8 lib/jets/job/helpers/log_event_helper.rb
jets-4.0.7 lib/jets/job/helpers/log_event_helper.rb
jets-4.0.6 lib/jets/job/helpers/log_event_helper.rb
jets-4.0.5 lib/jets/job/helpers/log_event_helper.rb
jets-4.0.4 lib/jets/job/helpers/log_event_helper.rb
jets-4.0.3 lib/jets/job/helpers/log_event_helper.rb
jets-4.0.2 lib/jets/job/helpers/log_event_helper.rb
jets-4.0.1 lib/jets/job/helpers/log_event_helper.rb