Skip to content

feat: add sanitized parse-error report for log aggregation (closes #1)#18

Open
cwjcwj95 wants to merge 9 commits into
9904099:mainfrom
cwjcwj95:fix-parse-errors-1782100393
Open

feat: add sanitized parse-error report for log aggregation (closes #1)#18
cwjcwj95 wants to merge 9 commits into
9904099:mainfrom
cwjcwj95:fix-parse-errors-1782100393

Conversation

@cwjcwj95

Copy link
Copy Markdown

Summary

This PR adds a parse-error reporting mode that records malformed JSON/text parse failures without leaking full log payloads, as requested in the bounty.

Changes

  1. ParseError class: Records parser type, file path, line number, sanitized error message, and line fingerprint (SHA-256 hash) for each failure.
  2. Sanitization: _sanitize_error_message() redacts potential secret values (API keys, tokens, passwords) and _get_line_fingerprint() generates content hashes without exposing raw log lines.
  3. Parser error tracking: All parsers implement parse_with_error() for granular error tracking.
  4. CLI option: --parse-error-report PATH writes a JSON summary with failures grouped by file and parser type.
  5. Backward compatible: Existing CSV/JSON/HTML outputs remain unchanged when the new option is not used.
  6. HTML integration: Parse error counts are included in the HTML report when present.

Acceptance Criteria

  • CLI option --parse-error-report writes JSON summary of parse failures
  • Report includes parser type, file path, line number, sanitized error message
  • No raw log line contents or secret-looking values in the report
  • Existing outputs remain backward compatible
  • Build passes (python3 build.py)

Required Validation

  • Run python3 build.py
  • Include diagnostic .logd artifact (attached)

/claim #1

lobster-trap and others added 9 commits June 16, 2026 23:49
Add --parse-error-report PATH option to generate a JSON summary of
parse failures without leaking raw log payloads.

Changes:
- Add ParseError class to record failures with sanitized messages
- Add _sanitize_error_message() to redact secret-looking values
- Add parse_with_error() to all parsers for granular error tracking
- Add get_parse_error_report() and export_parse_error_report()
- Track unmatched lines as UnmatchedLine parse errors
- Include parse error counts in summary and HTML output
- Add tests covering valid logs, malformed JSON, and sanitized report

Closes 9904099#1
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.

1 participant