Skip to main content
Version: v1.1.0

parse_zson

Function

parse_zson parse ZSON text into a Zed value

Synopsis

parse_zson(s: string) -> any

Description

The parse_zson function parses the s argument that must be in the form of ZSON into a Zed value of any type. This is analogous to JavaScript's JSON.parse() function.

Examples

echo '{foo:"{a:\"1\",b:2}"}' | zq -z 'foo := parse_zson(foo)' -

Output:

{foo:{a:"1",b:2}}