35 releases

0.13.0-rc.33 Oct 23, 2024
0.13.0-rc.20 Apr 10, 2024
0.13.0-rc.16 Oct 10, 2023
0.13.0-rc.14 Jun 23, 2023
0.1.0 Mar 7, 2020

#336 in Database interfaces

26 downloads per month
Used in 3 crates (2 directly)

Apache-2.0

40KB
944 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

~3MB
~43K SLoC