Stream Processor
Description
Process file data streams with per-line transformations, pattern filtering, and summary aggregation. Supports log, CSV, and JSON line formats.
Usage
/stream-processor <source> [--mode log|csv|json] [--filter pattern]
Modes
| Mode | Description | Auto-detect |
|---|---|---|
| log | Plain text / log file processing | .log, .txt files |
| csv | CSV with header row | .csv, .tsv files |
| json | JSON Lines (one object per line) | .jsonl, .ndjson |
Features
- Filtering:
--filter <regex>filters lines matching the pattern - Auto-detect: Mode is inferred from file extension if not specified
- Aggregation: Counts, top values, field distribution
- Large files: Streams line-by-line, no full-file memory load
Output Example
Stream Processing Report
========================
Source: logs/app.log
Mode: log
Filter: ERROR
Lines: 1,450 total, 23 matched
Top Patterns:
[ERROR] Database connection timeout — 12 occurrences
[ERROR] Authentication failed — 8 occurrences
[ERROR] File not found — 3 occurrences