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