Skip to content

[BUG] JSONL exporter adds trailing comma #5860

@bf-rbrown

Description

@bf-rbrown

Is there an existing issue for this?

  • I have searched the existing issues.

Current Behavior

JSONL format is to be newline delimited: https://jsonlines.org/.
PR #5705 introduced a comma into the -jsonl-output parameter:
line 90

This makes the output file not jsonline compliant and throws errors when parsing:

$ cat output.testing | jq 1>/dev/null
parse error: Expected value before ',' at line 1, column 33773

Expected Behavior

-jsonl-export flag should produce a jsonl file that is newline delimited without a trailing comma.

Steps To Reproduce

Run a nuclei scan with the -jsonl-export flag
observe the trailing comma in the results.jsonl file.

Relevant log output

Environment

- OS: Ubuntu
- Nuclei: v3.3.6
- Go: go1.22.0

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions