20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/fluent/plugin/formatter_sekoia.rb', line 20
def format(tag, time, record)
log.debug("Record")
log.debug(record.map { |k, v| "#{k}=#{v}" }.join('&'))
msg = SEKOIA::Formatter.format(
log: record['log'],
timestamp: time,
app_name: record.dig(*@app_name_field_array) || "-",
proc_id: record.dig(*@proc_id_field_array) || "-",
intake_key: record.dig(*@intake_key_array) || ""
)
log.debug("RFC 5424 Message")
log.debug(msg)
return msg + "\n" unless @rfc6587_message_size
msg.length.to_s + ' ' + msg
end
|