Sha256: ed9cf1b15dd40d6b7c107b869c1651810fbbabf046b235738c49610ccff1dfe0
Contents?: true
Size: 562 Bytes
Versions: 2
Compression:
Stored size: 562 Bytes
Contents
require 'time' module SoarAuditingFormatter #TODO check if we can do "#{field} here " FORMAT="%s,%s,%s,%s" unless defined? FORMAT; FORMAT.freeze OPTIONAL_FIELD_FORMAT = "[%s:%s]" unless defined? OPTIONAL_FIELD_FORMAT; OPTIONAL_FIELD_FORMAT.freeze class Formatter def self.format(level, flow_id, timestamp, message) times = Time.parse(timestamp.to_s).utc.iso8601(3) sprintf(FORMAT, level, flow_id, times, message) end def self.optional_field_format(key, value) sprintf(OPTIONAL_FIELD_FORMAT, key, value) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
soar_auditing_format-0.0.2 | lib/soar_auditing_format/formatter.rb |
soar_auditing_format-0.0.1 | lib/soar_auditing_format/formatter.rb |