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

JSON output may (should?) be NDJSON #19

Closed
p-l- opened this issue Apr 29, 2022 · 0 comments
Closed

JSON output may (should?) be NDJSON #19

p-l- opened this issue Apr 29, 2022 · 0 comments

Comments

@p-l-
Copy link

p-l- commented Apr 29, 2022

Hi there,

I think the JSON output should be NDJSON, as it is for a lot of other tools (Zgrab2 / Zdns, Masscan, Nuclei / dnsx / httpx, etc.).

What it means is that instead of having one really long line:

[{"result": 1}, {"result": 2}, {"result": 3}]

You would have one line per result:

{"result": 1}
{"result": 2}
{"result": 3}

The main advantage for tools parsing your result is that they could read the results line per line, instead of having to json.load() the whole result at once, storing it in memory.

You could take advantage of this to write the result as soon as they are available (as you do for the text output from what I understand). This would:

  • save a lot of memory since currently the whole JSON stays in the RAM before writing the result file;
  • allow interrupted scans to still produce exploitable results.

What do you think?

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

2 participants