Skip to content

Auto Parser

Automatically select the parser based on file extension. Default when parser is omitted.

Configuration

toml
parser = "auto"
# or omit entirely — auto is the default

Detection Rules

ExtensionParser UsedNotes
.jsonjsonSingle JSON object
.jsonl, .ndjsonjsonlJSON Lines
.csvcsv_rowCSV with header row
.xmlxmlRequires parser_xml feature
.taptapRequires parser_tap feature
.txt, .logtext_lineLine-by-line
Other / nonetext_lineDefault fallback

Use Cases

  • Mixed file format directories
  • Dynamic input sources where format is determined by extension

Example

toml
[sources.ci_outputs.extractor]
type = "opendal"
kind = "fs"
polling_interval = "30s"
recursive = true
path_patterns = ["**/*.json", "**/*.xml", "**/*.tap", "**/*.log", "**/*.csv"]
parser = "auto"
parameters = { root = "/var/ci/outputs" }

CLI Usage

bash
cdviz-collector send --data @event.json --input-parser auto
cdviz-collector send --data @junit.xml --input-parser auto