#syslog #encoder #parser

nightly no-std syslog_proto

I/O-free implementation of the syslog protocol

1 unstable release

Uses new Rust 2024

0.1.0-alpha0 Oct 20, 2025

#26 in #syslog

MIT license

45KB
1.5K SLoC

syslog_proto

This crate implements the syslog protocol as described in RFC5424. It intentionally does not implement any I/O functionality and provides protocol structures and parsing in a #![no_std]-compatible way.

The intent behind this crate was originally to support being a syslog receiver for nginx access logs — I was going to write a lightweight bridge that put them on NATS or MQTT, with the goal of making it easier to monitor and action recalcitrant scraper bots (while avoiding generating a huge access.log file that would require rotation). I found that geoip filtering was an easier approach, but was still interested in completing the crate because the alternatives I came across with a few quick Google searches (syslog, possibly others) only provide the message-generation logic and try to provide utility by integrating with the Rust logging ecosystem. The goal here is not to do that, but to expose the actual syslog message primitives at relatively low overhead.

I've yet to do any benchmarking or use this in anger. Some tests are included — it parses the example messages from the RFC, and there are some proptests that I ran with a reasonably high (100k) iteration count.

todo

  • fixup item visibilities
  • benchmarks
  • proptests on not-yet-covered types
  • actually write that nginx bridge / integrate it with something
  • #[deny(missing_docs)]
  • clippy lints
  • nix flake
  • code size profiling (i've yet to see how nom does)
  • allocation tracing: should be zero for parsing
  • structured data: well-known sd-name lookups
  • #[cfg_attr(feature = "serde", serde::Serialize, serde::Deserialize)]

Dependencies

~2.5–3.5MB
~61K SLoC