#tremor #logstash #key-value #parser

tremor-kv

A logstash inspured key value extractor

12 releases

0.6.2 Oct 26, 2023
0.6.0 May 24, 2023
0.5.0 Nov 3, 2022
0.4.0 Jul 8, 2022
0.1.2 Mar 4, 2020

#2 in #logstash

Download history 146/week @ 2023-10-30 130/week @ 2023-11-06 289/week @ 2023-11-13 186/week @ 2023-11-20 168/week @ 2023-11-27 41/week @ 2023-12-04 83/week @ 2023-12-11 34/week @ 2023-12-18 50/week @ 2023-12-25 33/week @ 2024-01-01 34/week @ 2024-01-08 32/week @ 2024-01-15 31/week @ 2024-01-22 42/week @ 2024-01-29 30/week @ 2024-02-05 76/week @ 2024-02-12

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

Apache-2.0

28KB
551 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

~5.5MB
~103K SLoC