Skip to content

ISSUE-570: Enhance rayhunter-check output#1015

Open
herbenderbler wants to merge 1 commit into
EFForg:mainfrom
herbenderbler:ISSUE-570/check-output
Open

ISSUE-570: Enhance rayhunter-check output#1015
herbenderbler wants to merge 1 commit into
EFForg:mainfrom
herbenderbler:ISSUE-570/check-output

Conversation

@herbenderbler

@herbenderbler herbenderbler commented May 2, 2026

Copy link
Copy Markdown

Adds a machine readable output mode to rayhunter-check so its analysis can be picked up by other tools, not just read off the terminal. Fixes #570. Replaces closed #941.

  • --format json prints a JSON array of per file reports ({ path, metadata, rows }) to stdout. Pass --output <dir> to also drop a copy of each as <dir>/<input>.json.
  • --pcapify writes the PCAPNG next to each QMDL, or into --output when it is given.
  • Output files are named after the input (<input>.<ext>), existing files are never overwritten, and dotted or shared stems no longer collide.
  • --show-skipped adds the skipped rows. Logs go to stderr, so stdout stays clean.
  • A file that cannot be opened or parsed is skipped and the run exits nonzero, rather than bailing out entirely. Directories or broken links that happen to match a capture name are skipped too.
  • Legacy pcap is read alongside pcapng. Link layer framing is stripped and timestamps are shifted onto the epoch the analyzer expects.
  • In lib, analyze_pcap_packet now treats a packet too short for GSMTAP as a skipped row instead of panicking.

Also adds anyhow, rebases onto latest main, and updates doc/reanalyzing.md.

AI disclosure

Generative AI (Claude) was used to help write this pull request, including code, comments, and this description. I have read, understand, and take responsibility for all of the changes.

@cooperq cooperq self-assigned this May 6, 2026
@cooperq

cooperq commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

coming back to this I think we need to output as json instead of Nd json. If this is somethig you are still interested in lets work on that and rebase this.

@herbenderbler
herbenderbler force-pushed the ISSUE-570/check-output branch 2 times, most recently from ab2b251 to ef3768a Compare June 30, 2026 05:31
@herbenderbler

Copy link
Copy Markdown
Author

coming back to this I think we need to output as json instead of Nd json. If this is somethig you are still interested in lets work on that and rebase this.

let me know how this lands with you whenever you get a chance.

@herbenderbler
herbenderbler force-pushed the ISSUE-570/check-output branch 5 times, most recently from 48f40bc to 905b470 Compare July 16, 2026 21:10
`--format json` writes a JSON array of per-file { path, metadata, rows }
reports to stdout; `--output` also writes each as <output>/<input>.json.
`--pcapify` writes PCAPNG beside each QMDL by default, or under --output.
Output files are named <input>.<ext> so dotted stems and same-stem
.qmdl/.pcap pairs don't collide; existing files are never overwritten.
`--show-skipped` includes skipped-message rows. Logging goes to stderr so
stdout stays clean for jq.

A file that can't be opened or parsed is skipped with an error and the run
continues (exit code 1 if any input failed) rather than aborting and
forfeiting every report; mid-stream read errors keep rows processed so far.
Legacy pcap files are accepted alongside pcapng, detected by magic number,
with link-layer framing stripped and timestamps rebased to the epoch the
analyzer expects. Packets too short for GSMTAP are reported as skipped rows
instead of panicking (lib). pcapify removes its partial output on write
failure so the refuse-to-overwrite guard can't pin a corrupt file.
@herbenderbler
herbenderbler force-pushed the ISSUE-570/check-output branch from 905b470 to e390cab Compare July 16, 2026 22:06
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

Successfully merging this pull request may close these issues.

enhance rayhunter-check output

2 participants