#influx #map #parser

tremor-influx

Tremor Influx Parser

2 unstable releases

new 0.2.0 Oct 16, 2020
0.1.0 Mar 7, 2020

#428 in Embedded development

Download history 869/week @ 2020-06-28 1315/week @ 2020-07-05 399/week @ 2020-07-12 470/week @ 2020-07-19 511/week @ 2020-07-26 526/week @ 2020-08-02 829/week @ 2020-08-09 346/week @ 2020-08-16 84/week @ 2020-08-23 163/week @ 2020-08-30 403/week @ 2020-09-06 128/week @ 2020-09-13 28/week @ 2020-09-20 62/week @ 2020-09-27 54/week @ 2020-10-04 162/week @ 2020-10-11

1,221 downloads per month
Used in 2 crates (via tremor-script)

Apache-2.0

36KB
879 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

~4MB
~65K SLoC