influxdb_line_protocol
This crate contains pure Rust implementations of
-
A parser for InfluxDB Line Protocol developed as part of the InfluxDB IOx project. This implementation is intended to be compatible with the Go implementation, however, this implementation uses a nom combinator-based parser rather than attempting to port the imperative Go logic so there are likely some small differences.
-
A builder to construct valid InfluxDB Line Protocol
Example
Here is an example of how to parse the following line
protocol data into a ParsedLine
:
cpu,host=A,region=west usage_system=64.2 1590488773254420000
use ;
let mut parsed_lines =
parse_lines;
let parsed_line = parsed_lines
.next
.expect
.expect;
let ParsedLine = parsed_line;
assert_eq!;
let tags = series.tag_set.unwrap;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
let field = &field_set;
assert_eq!;
assert_eq!;
assert_eq!;