29 releases

0.13.0-rc.16 Oct 10, 2023
0.13.0-rc.14 Jun 23, 2023
0.13.0-rc.11 Dec 21, 2022
0.13.0-rc.9 Nov 11, 2022
0.1.0 Mar 7, 2020

#5 in #influx

Download history 37/week @ 2023-10-31 17/week @ 2023-11-07 35/week @ 2023-11-14 37/week @ 2023-11-21 42/week @ 2023-11-28 3/week @ 2023-12-05 4/week @ 2023-12-12 33/week @ 2023-12-19 62/week @ 2023-12-26 31/week @ 2024-01-02 9/week @ 2024-01-09 33/week @ 2024-01-16 9/week @ 2024-01-23 64/week @ 2024-01-30 8/week @ 2024-02-06 163/week @ 2024-02-13

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

Apache-2.0

39KB
931 lines

influx parser


Influx wire protocol parsing

Parses a influx wire protocol into a map.

Use as a library

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

The parser can also be used standalone

  let s = "weather,location=us-midwest temperature_str=\"too hot\\\\\\\\\\cold\" 1465839830100400206";
  let r: Value = json!({
    "measurement": "weather",
    "tags": {
      "location": "us-midwest"
    },
    "fields": {
       "temperature_str": "too hot\\\\\\cold"
    },
    "timestamp": 1_465_839_830_100_400_206i64, }
  ).into();
  assert_eq!(Ok(Some(r)), decode(s, 0))

lib.rs:

Influx line protocol decoder to simd_json::Value

The translate is done to the following schema:

{
   "measurement": "<name>",
   "tags": {
     "tag1": "<value>"
   },
   "fields": {
     "field1": 123
   },
   "timestamp": 456
}

Dependencies

~2.5MB
~38K SLoC