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.0 lib/jets/job/helpers/log_event_helper.rb
jets-3.2.2 lib/jets/job/helpers/log_event_helper.rb
jets-3.2.1 lib/jets/job/helpers/log_event_helper.rb
jets.benforeva-3.0.17.pre.mount.pre.fix lib/jets/job/helpers/log_event_helper.rb
jets-3.2.0 lib/jets/job/helpers/log_event_helper.rb
jets-3.1.5 lib/jets/job/helpers/log_event_helper.rb
jets-3.1.4 lib/jets/job/helpers/log_event_helper.rb
jets-3.1.3 lib/jets/job/helpers/log_event_helper.rb
jets-3.1.2 lib/jets/job/helpers/log_event_helper.rb
jets-3.1.1 lib/jets/job/helpers/log_event_helper.rb
jets-3.1.0 lib/jets/job/helpers/log_event_helper.rb
jets-3.0.23 lib/jets/job/helpers/log_event_helper.rb
jets-3.0.22 lib/jets/job/helpers/log_event_helper.rb
jets-3.0.21 lib/jets/job/helpers/log_event_helper.rb
jets-3.0.20 lib/jets/job/helpers/log_event_helper.rb
jets-3.0.19 lib/jets/job/helpers/log_event_helper.rb
jets-3.0.18 lib/jets/job/helpers/log_event_helper.rb
jets-3.0.17 lib/jets/job/helpers/log_event_helper.rb
jets-3.0.16 lib/jets/job/helpers/log_event_helper.rb
jets-3.0.15 lib/jets/job/helpers/log_event_helper.rb