Skip to content

IIS and JSON access logs; big and idle files - #5

Merged
FMXExpress merged 1 commit into
mainfrom
log-formats
Oct 31, 2026
Merged

FMXExpress merged 1 commit into
mainfrom
log-formats

Conversation

@FMXExpress

Copy link
Copy Markdown
Owner

Adds support for more log formats. jevban detects the format line by line, so one daemon can follow a mix.

Formats

  • IIS W3C Extended (u_ex*.log), with any set of fields. The columns come from each file's #Fields: header:
    • The header is tracked per file, including when it changes mid-file.
    • When the daemon starts in the middle of a file, it scans backwards for the last header.
    • With no header, IIS's default field set is used.
  • JSON, one object per line:
    • nginx log_format ... escape=json with its usual variable names;
    • Caddy's access log (nested request, header arrays);
    • Traefik's JSON access log (ClientAddr with a port).
  • Apache and nginx text work exactly as before.

Every format fills the same entry and is escaped the way Apache escapes %r, so signatures, rules and the model see identical input. The same 200,000 requests written as Apache, nginx JSON and IIS get identical decisions: 2,785 suspicious, 1,640 strikes and 1,630 bans in each. bench/run.sh now checks this every run (bench/formats.py).

Parse speed, one core:

Format Lines/s
Apache 20–27k
IIS 20–22k
JSON 12–14k

Big and idle files (measured with 1 GB logs)

  • Daemon start on a 1 GB Apache or IIS log: 0.28 s and 4 MB RSS. On the IIS file the only #Fields: header is a gigabyte back at the top, and new lines still parse.
  • --test replay of 1 GB (6.4M lines): 89 s, 9 MB peak RSS.
  • Idle files: IIS keeps every daily log, so a wildcard pattern used to hold a handle on all of them. Wildcard matches that haven't been written for a day are now skipped. A followed file that's fully read and idle for a day is let go, and picked up where it left off if written again (checked: handle released, reopened, no old lines replayed).

Unchanged

  • Apache quality is identical to main on every corpus.
  • An alternating A/B of throughput showed no difference beyond noise.

Unit tests: 142 checks, 0 failed (17 new). Iteration notes are in bench/results/iter6-formats/README.md.

This branch is independent of FMXExpress/JevBan#4 and can be merged before or after it.


Generated by Claude Code

Lines are recognised per line: Apache/nginx text, JSON (nginx escape=json,
Caddy, Traefik), and IIS W3C with the columns from each file's #Fields:
header, tracked per file by the tailer and looked up backwards when the
daemon starts mid-file. The same requests in all three formats get the
same decisions (bench/formats.py, now part of bench/run.sh).

Wildcard matches idle for a day are skipped or let go (IIS keeps every
daily log) and resumed where they were if written again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NPVFJFY41846T15QqxmGW2
@FMXExpress
FMXExpress merged commit abaecd0 into main Oct 31, 2026
2 checks passed
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.

2 participants