Guides

Ingest data

Ingest unstructured data from inline payloads, files, and public URLs.

Ingest data

RawTree accepts unstructured data without a schema step. A table is created automatically on first insert.

Inline data

rtree insert --table events \
  --data '{"action":"signup","user_id":1}'

Use an array to insert multiple rows:

rtree insert --table events \
  --data '[{"action":"signup","user_id":1},{"action":"purchase","user_id":1,"amount":42}]'

Files

rtree insert --table events --file ./events.jsonl

JSONL is useful for large event streams because each line is one event.

Public URLs

rtree insert --table events --url https://example.com/events.jsonl

URL ingest streams progress events through the API and CLI.

Built-in transforms

Use transforms when the source format needs to be flattened before insert. A transform is a built-in preprocessor for JSON body inserts: RawTree reads the source JSON, emits one or more flat rows, then inserts those rows into the table.

rtree insert --table traces \
  --data '{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"api"}}]},"scopeSpans":[{"spans":[{"name":"GET /health","spanId":"abc"}]}]}' \
  --transform otlp-traces

The API accepts the same transform through the transform query parameter on a JSON body insert:

curl -X POST "https://api.rawtree.com/v1/tables/traces?transform=otlp-traces" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"api"}}]},"scopeSpans":[{"spans":[{"name":"GET /health","spanId":"abc"}]}]}'

Transforms are not supported with URL inserts. If you use ?url=, transform the data before hosting it.

See Transforms for supported input shapes and emitted rows.

TransformSource format
otlp-tracesOpenTelemetry trace payloads
otlp-logsOpenTelemetry log payloads
otlp-metricsOpenTelemetry metric payloads
cloudwatch-logsAWS CloudWatch Logs subscription or delivery payloads
cloudtrailAWS CloudTrail records

API insert

curl -X POST "https://api.rawtree.com/v1/tables/events" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"action":"signup","user_id":1}]'

Verify the insert

rtree table describe events
rtree query "SELECT count() FROM events"