Class: LogStash::Codecs::GoogleAppengine

Inherits:
Base
  • Object
show all
Defined in:
lib/logstash/codecs/google_appengine.rb

Instance Method Summary collapse

Instance Method Details

#decode(data) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/logstash/codecs/google_appengine.rb', line 17

def decode(data)
  begin
    @json.decode data do |json|
      if is_parse_failure json
        @logger.error("Failed to process data", :data => json)
      else
        flatten(json).each { |flattenedJson|
          yield LogStash::Event.new flattenedJson
        }
      end
    end
  rescue => e
    @logger.error "Failed to process data", :error => e, :data => data
  end
end

#registerObject



12
13
14
15
# File 'lib/logstash/codecs/google_appengine.rb', line 12

def register
  @json = LogStash::Codecs::JSON.new
  @md5 = Digest::MD5.new
end