Skip to content

Document that JSON format is actually JSON lines format #1191

@MattDodsonEnglish

Description

@MattDodsonEnglish
Contributor

The JSON is output is not really JSON, but JSON lines. Proper JSON would be enclosed in square brackets with each item in the array separated by commas. The JSON lines format just puts all objects on its own line.

The implication is that a little pre-processing needs to be done to be usable by something like node's readFile. Jq could do it with jq -s '.' ./result.json > result-array.json.

As I understand, JSON lines makes it possible to stream the output, so the output has advantages. But, the correct format should be documented in the JSON output page.

Related k6 issue: grafana/k6#737

Activity

changed the title [-]Document that json format is actually JSON lines format[/-] [+]Document that JSON format is actually JSON lines format[/+] on May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Tech WritersIssues that a writer could help withType: BugSomething doesn't work how it should

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @MattDodsonEnglish

        Issue actions

          Document that JSON format is actually JSON lines format · Issue #1191 · grafana/k6-docs