Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operator to convert Zed values to JSON equivalents #4566

Open
philrz opened this issue Apr 30, 2023 · 0 comments
Open

Operator to convert Zed values to JSON equivalents #4566

philrz opened this issue Apr 30, 2023 · 0 comments

Comments

@philrz
Copy link
Contributor

philrz commented Apr 30, 2023

At the time of the filing of this issue, Zed is at commit 4ffdf3e. This idea came up while the team was looking at the examples that motivated the opening of #4555 and #4565.

There's tons of tools out there that require JSON as input, and many Zed users still rely on those tools and may need to feed the output from their Zed queries into them. Since turning richer Zed values into JSON will likely "dumb down" many of the values (e.g., IP addresses become strings, sets become arrays, etc.) such users are likely to want to closely examine that JSON output while iterating on their Zed scripts so they know it will be a match for their downstream JSON tooling. Right now the easiest way to see that JSON output is to use the -j flag on zed or zq, which is ok, but if the user is working in Zui, now they either need to Export to JSON or jump to the shell to run zed on their lake behind Zui, which is less convenient. Therefore it might be handy to have an operator in Zed that effectively does all the same conversions that would happen with -j but still keep the values as Zed types in the pipeline. Now the user could see the would-be JSON output right in Zui, pretty-print it at the shell with -Z, do further processing in the pipeline knowing the values have been "reset" to JSON-level simplicity, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant