json.parse() function

The json.parse() function is experimental and subject to change at any time. By using this function, you accept the risks of experimental functions.

The json.parse() function takes JSON data as bytes and returns a value. The function can return lists, records, strings, booleans, and float values. All numeric values are returned as floats.

Function type: Type conversion

import "experimental/json"

  data: bytes(v: "{\"a\":1,\"b\":2,\"c\":3}")



JSON data to parse.

Data type: Bytes


Parse and use JSON data to restructure a table
import "experimental/json"

  |> map(fn: (r) => {
      jsonData = json.parse(data: bytes(v: r._value))

      return {
        _time: r._time,
        _field: r._field,
        a: jsonData.a,
        b: jsonData.b,
        c: jsonData.c,

Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: