Ingestion Overview

All supported input paths and how they reach the same batch evaluation engine.

BlazeRules evaluates batches. Every input path either already is a batch, or collects records until a batch is ready.

flowchart LR
  json["JSON / NDJSON"] --> engine["RuleEngine"]
  arrow["Arrow / PyArrow"] --> engine
  kafka["Kafka"] --> io["blazerules_io"]
  ipc["Arrow IPC / Avro / Protobuf"] --> io
  s3["S3 / local files"] --> io
  http["HTTP /v1/logs"] --> agent["blazerules_agent"]
  stdin["stdin"] --> agent
  tail["file_tail"] --> agent
  k8s["Kubernetes pod logs"] --> agent
  io --> engine
  agent --> engine
  engine --> decisions["decisions / scores / rule counts"]
  engine --> dlq["dead-letter records"]

Input Matrix

InputAPI or componentBest for
NDJSON bytesengine.evaluate_ndjson(bytes)Raw event streams, JSON logs, HTTP batches.
JSON string listengine.evaluate_messages(list[str])Small scripts and simple tests.
PyArrow batchengine.evaluate_batch(batch)Typed pipelines and fastest non-JSON path.
Kafkablazerules_io.KafkaConsumer, run_stream(...)Brokered streams with offset handling.
HTTP logs/eventsblazerules_agent --input httpApps POST NDJSON to a local listener.
stdinblazerules_agent --input stdinTerminal output, process logs, shell pipelines.
File tailblazerules_agent --input file_tailPod stdout/stderr files and node-local logs.
Plain text logswrap lines as JSON firstUnstructured terminal/stdout/stderr text.
KubernetesHelm chart DaemonSetNode-local log collection and dashboard sidecar/deployment.
Debezium CDCblazerules_io.unwrap_debezium(...)Database change streams.
Arrow IPCblazerules_io.ArrowIpcDecoderBinary Arrow frames.
Avroblazerules_io.AvroDecoderSchema-based binary events.
Protobufblazerules_io.ProtobufDecoderDescriptor-backed binary events.
S3 / local filesread_ndjson_bytes, read_record_batchesBacktests, batch files, rules, lookups, and models.

Record Shape

JSON records can be flat or nested. Rules use dotted paths:

conditions:
  and:
    - field: merchant.risk.score
      op: gt
      value: 50
    - array_any:
        path: items
        where:
          and:
            - field: price
              op: gt
              value: 100
            - field: category
              op: eq
              value: electronics

Arrow, Avro, Protobuf, and PyArrow inputs use the same logical field names. Nested structs are projected into the same dotted namespace, so a rule does not care which wire format produced the batch.

Error Handling

Rules and lookups fail fast at load time. Ingest can be tolerant:

  • SKIP_AND_COUNT: skip malformed records and count/sample errors.
  • SKIP_TO_DEAD_LETTER: write bad rows to an NDJSON dead-letter file.
  • HARD_FAIL: throw on the first malformed row.

See Decision and DLQ Logs and Handle Dirty Data.

Recipes