tpt-logfmt-parse
Zero-copy, high-performance logfmt parser for Rust. No dependencies.
Logfmt is the key=value structured logging format used by Heroku, Datadog agents, and many Go services.
Features
- Zero-copy iterator — yields
(&str, &str)slices directly into the input string - Owned convenience API —
parse_to_map()returnsHashMap<String, String>with escape sequences resolved - No dependencies — pure Rust, no
regex, no allocations in the iterator path - Handles quoted strings,
\"/\\/\n/\tescape sequences, and bare keys (no=)
Usage
Zero-copy iterator
use LogfmtParser;
let input = r#"level=info msg="hello world" latency=42ms"#;
for pair in new
Owned HashMap
use parse_to_map;
let map = parse_to_map.unwrap;
println!; // disk full
License
Licensed under either of Apache License 2.0 or MIT at your option.