Sha256: 8755176f12b13c58db5b3cc98512fcb175c82f780079650c74cbaac5ca4d59b8
Contents?: true
Size: 545 Bytes
Versions: 2
Compression:
Stored size: 545 Bytes
Contents
require 'time' module SoarAuditingFormatter FORMAT="%s,%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, service_id, flow_id, timestamp, message) times = Time.parse(timestamp.to_s).utc.iso8601(3) sprintf(FORMAT, level, service_id, 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.5 | lib/soar_auditing_format/formatter.rb |
soar_auditing_format-0.0.4 | lib/soar_auditing_format/formatter.rb |