Crate syslog_heroku [−] [src]
This module implements a parser for Heroku (Logplex) syslog messages, which is useful when implementing a Logplex HTTP Drain.
These syslog messages are similar to RFC5424 messages,
with the notable exception that they leave out STRUCTURED-DATA
but do not replace it with a NILVALUE
.
Usually, you'll just use the FromStr
trait on the Message
struct to parse a message.
Example
use syslog_heroku::Message; fn main() { let msg = "<45>1 2018-02-28T09:30:53.345547+00:00 host heroku web.1 - Process exited with status 143" .parse::<Message>().unwrap(); println!("{:?} {:?} {:?}", msg.severity, msg.hostname, msg.msg); }
Structs
Message |
Represents a message being send to a Heroku Log Drain |
Enums
ParseError |
Signals a failure when parsing an incoming message |
Severity |
Indicates the severity of the message |