Skip to content

Parsers

Parsers convert file contents into JSON messages for the CDviz pipeline.

Where Parsers Are Used

  • send command: Submit CI/CD artifacts directly from pipelines (--input-parser)
  • OpenDAL source: Parse files from filesystem or cloud storage (parser = "...")
  • transform command: Batch file processing (auto-detects format)

Quick Reference

ParserFormatOutputUse Case
autoAuto-detectVariesDefault — detects format by file extension
jsonJSON1 messageSingle JSON object per file
jsonlJSON LinesN messagesOne message per line
csv_rowCSVN messagesOne message per row (header as keys)
textPlain text1 messageEntire file as {"text": "..."}
text_linePlain textN messagesOne message per non-empty line
xmlXML1 messageXML converted to JSON structure
tapTAP format1 messageTest Anything Protocol results
metadataAny1 messageFile metadata only (no content)

Feature Flags

xml and tap parsers require feature flags in the collector build:

bash
cargo install cdviz-collector --features parser_xml,parser_tap

Built-in (always available): json, jsonl, csv_row, text, text_line, metadata, auto

CLI Usage

bash
# In CI/CD pipelines
cdviz-collector send --data @junit-report.xml --input-parser xml --url $CDVIZ_URL
cdviz-collector send --data @lint-report.txt --input-parser text_line --url $CDVIZ_URL
cdviz-collector send --data @events.jsonl --input-parser jsonl --url $CDVIZ_URL