class Fluent::Plugin::HerokuSyslogHttpParser

Constants

FACILITY_MAP
SEVERITY_MAP
SYSLOG_HTTP_REGEXP

Public Instance Methods

parse(text) { |time, parse_prival(record)| ... } click to toggle source
Calls superclass method
# File lib/fluent/plugin/parser_heroku_syslog_http.rb, line 64
def parse(text)
  super(text) do |time, record|
    yield time, parse_prival(record)
  end
end
parse_prival(record) click to toggle source
# File lib/fluent/plugin/parser_heroku_syslog_http.rb, line 55
def parse_prival(record)
  if record && record['syslog.pri']
    pri = record['syslog.pri'].to_i
    record['syslog.facility'] = FACILITY_MAP[pri >> 3]
    record['syslog.severity'] = SEVERITY_MAP[pri & 0b111]
  end
  record
end