#tremor #kv #logstash #tremor-script

tremor-kv

A logstash inspured key value extractor

9 unstable releases (4 breaking)

0.5.0 Nov 3, 2022
0.4.0 Jul 8, 2022
0.3.0 Jun 1, 2022
0.2.1 May 31, 2022
0.1.0 Feb 22, 2020

#318 in Rust patterns

Download history 231/week @ 2022-08-14 148/week @ 2022-08-21 234/week @ 2022-08-28 204/week @ 2022-09-04 250/week @ 2022-09-11 157/week @ 2022-09-18 172/week @ 2022-09-25 145/week @ 2022-10-02 164/week @ 2022-10-09 280/week @ 2022-10-16 196/week @ 2022-10-23 236/week @ 2022-10-30 336/week @ 2022-11-06 159/week @ 2022-11-13 202/week @ 2022-11-20 199/week @ 2022-11-27

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

Apache-2.0

26KB
529 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

~4MB
~72K SLoC