Syslog v0.1.0 Syslog.Parser View Source

Module to handle the parsing of various acceptable forms of a Syslog message as described in RFC3164 and RFC5426. Additionally, various other forms of syslog messages are accepted, as found “in the wild”.

Improperly formatted Syslog messages are normalized while parsing, so that the output Syslog.Entry returned is completely populated. The methods for normalization are handled in the manner described in the RFCs above.

The parser also handles a special form of structured data content, which is a form that pre-dates RFC5424. All key-value pairs found inside a message are extracted in to the Syslog.Entry returned, under the kvps Map field.

Link to this section Summary

Functions

Parses a binary blob containing a Syslog Message

Link to this section Functions

Parses a binary blob containing a Syslog Message.

Returns Syslog.Entry.

Examples

iex> Syslog.Parser.parse('<12>Jul  7 16:05:00.12312 myhostname tag[123]: a message')
%Syslog.Entry{arrival_datetime: nil, datetime: ~N[2017-07-07 16:05:00.123120],
 facility: :user, hostname: "myhostname", ip: nil, kvps: %{},
 message: "a message", pid: "123", port: nil, priority: 12, process: "tag",
 severity: :warn}