Stdin
Reads JSON or another format from stdin. Use it to pipe a command into Mfd. This is not a long-running server — the process ends when stdin closes.
Before you begin
- A producer that writes records to stdout (one JSON object per line for
json).
Configure
python
from mfd import Config, DataSourceStdin, Pipeline
cfg = Config.discover()
src = cfg.data_source("pipe", DataSourceStdin(mode="batch", format="json"))
cfg.pipeline("pipe", Pipeline(data_source=src))
cfg.save()bash
mfd connect data-source stdin \
--pipeline pipe \
--name pipe \
--mode batch \
--format jsonyaml
data_sources:
pipe:
Stdin:
mode: batch
format: jsonbash
cat events.jsonl | mfd sync --pipeline pipe --onceOptions
| Key | Type | Required/Default | Description |
|---|---|---|---|
mode | string | batch | batch finishes when stdin closes. stream keeps reading until Mfd stops. JSON is still one object per line. |
format | string | Not set | Payload format: json, csv, xml, or avro |
batch_size_bytes | integer | Not set | Max bytes per batch |
batch_size_seconds | integer | Not set | Max seconds per batch |
What gets synced
Each framed payload becomes a record. There is no resume position beyond what the WAL already committed. If you re-run the same pipe, rows can duplicate in append-only destinations.
Troubleshooting
| Symptom | Fix |
|---|---|
| No rows | Confirm the producer writes to stdout and the pipe is attached |
| Parse errors | Match format to the payload; JSON must be one object per line |
Next steps
- HTTP server — for push over the network
- Local file source
