Cursor Extractor «99% TOP»
@workspace Scan all .log files in /logs directory. Extract: error_code, timestamp, endpoint, status_code. Output: single JSON file with each entry keyed by filename. Ignore lines without errors. Save to /extractor/output/errors.json Cursor will generate a script or directly extract depending on your settings. File: extractor/run_extractor.py
extractor.save("extractor/output/structured_logs.json") Cursor Extractor
inside Cursor Composer today: “Extract all email addresses and dates from the selected text. Output JSON.” @workspace Scan all
That’s your first extraction. From there, build your own extractor library. Cursor Extractor
extractor = CursorExtractor(schema) for log_file in Path("data/raw/logs").glob("*.log"): content = log_file.read_text() extractor.extract_from_text(content, str(log_file))
Extract from the selected log file: - Timestamp (ISO format) - Error level (ERROR/WARN/INFO) - Message summary (max 50 chars) - Component name Return as JSON array.