16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/logstash/filters/google_appengine.rb', line 16
def filter(event)
return unless filter?(event)
payload = event['protoPayload']
payload.delete '@type'
lines = payload.delete 'line'
if lines
@logger.error("Encountered line event")
lines.each_with_index do |line, i|
next if line.empty?
line_data = payload.merge line
line_data['_id'] = @md5.hexdigest line_data['requestId'] + i.to_s
line_data['message'] = line_data.delete 'logMessage'
new_event = LogStash::Event::new(line_data)
filter_matched(new_event)
@logger.error("Emitting LINE event", 'line_event'=> new_event)
yield new_event
end
end
event.cancel
end
|