13 unstable releases

Uses new Rust 2024

new 0.7.0 Apr 25, 2025
0.6.2 Oct 26, 2023
0.6.0 May 24, 2023
0.5.0 Nov 3, 2022
0.1.2 Mar 4, 2020

#678 in Parser implementations

Download history 46/week @ 2025-01-04 31/week @ 2025-01-18 13/week @ 2025-01-25 2/week @ 2025-02-01 33/week @ 2025-02-08 16/week @ 2025-02-15 7/week @ 2025-02-22 6/week @ 2025-03-01 4/week @ 2025-03-15 1/week @ 2025-04-05 3/week @ 2025-04-12 48/week @ 2025-04-19

54 downloads per month
Used in 2 crates (via tremor-script)

Apache-2.0

28KB
570 lines

KV   Latest Version Build Status Quality Checks License Checks Security Checks Code Coverage

kv parser


KV parsing inspired by logstash's kv plugin.

Parses a string into a map. It is possible to split based on different characters that represent either field or key value boundaries.

A good part of the logstash functionality will be handled outside of this function and in a generic way in tremor script.

Use as a library

The kv parser was designed so that KV style parsing could be embedded into tremor's scripting language for extract operations.

The parser can also be used standalone

  let kv = Pattern::compile("%{key}%{%{val}").expect("Failed to build pattern");
  let r = kv.run("this%{is a%{test").expect("Failed to split input");
  assert_eq!(r.len(), 2);
  assert_eq!(r["this"], "is");
  assert_eq!(r["a"], "test");

Dependencies

~2.3–3.5MB
~71K SLoC