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

[BUG] JSONL exporter adds trailing comma #5860

Closed
1 task done
bf-rbrown opened this issue Nov 27, 2024 · 4 comments · Fixed by #5861
Closed
1 task done

[BUG] JSONL exporter adds trailing comma #5860

bf-rbrown opened this issue Nov 27, 2024 · 4 comments · Fixed by #5861
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Milestone

Comments

@bf-rbrown
Copy link
Contributor

bf-rbrown commented Nov 27, 2024

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

@bf-rbrown bf-rbrown added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Nov 27, 2024
@ehsandeep ehsandeep linked a pull request Nov 28, 2024 that will close this issue
4 tasks
@ehsandeep
Copy link
Member

ehsandeep commented Nov 28, 2024

@kchason was it intentional change here https://github.com/projectdiscovery/nuclei/pull/5705/files#diff-3318b3220dac210ed7ff197dab8d5dca1820c39754f9b4ba37ad6a1a209fcd56R90? looks like it broke jsonl fomatting with -jle option.

@kchason
Copy link
Contributor

kchason commented Nov 29, 2024

@kchason was it intentional change here https://github.com/projectdiscovery/nuclei/pull/5705/files#diff-3318b3220dac210ed7ff197dab8d5dca1820c39754f9b4ba37ad6a1a209fcd56R90? looks like it broke jsonl fomatting with -jle option.

No, definitely not intentional to break the format. I'll take a look

@kchason
Copy link
Contributor

kchason commented Nov 29, 2024

@kchason was it intentional change here https://github.com/projectdiscovery/nuclei/pull/5705/files#diff-3318b3220dac210ed7ff197dab8d5dca1820c39754f9b4ba37ad6a1a209fcd56R90? looks like it broke jsonl fomatting with -jle option.

No, definitely not intentional to break the format. I'll take a look

Sorry about that! I've got a patch in to remove the trailing commas at: #5864

@ehsandeep
Copy link
Member

@kchason np, it's being fixed in #5861, can you confirm the same?

@ehsandeep ehsandeep added this to the Nuclei v3.3.7 milestone Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants