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"]

The blazerules CLI (blazerules eval --input ...) is an equivalent entry point to the same engine for JSON/Arrow and the binary formats, taking files, stdin, or Kafka instead of in-memory objects.

Input Matrix

InputAPI or componentBest for
NDJSON bytesengine.evaluate_ndjson(bytes), or blazerules eval --input ndjsonRaw event streams, JSON logs, HTTP batches.
Top-level JSON arraysengine.evaluate_json_array(bytes), or blazerules eval --input json-arrayBatch APIs/files that already group events as one JSON array.
JSON string listengine.evaluate_messages(list[str]), or blazerules eval --input ndjsonSmall scripts and simple tests.
PyArrow batchengine.evaluate_batch(batch), or blazerules eval --input arrow-ipc|parquetTyped pipelines and fastest non-JSON path.
Kafkablazerules stream kafka, blazerules_io.KafkaConsumer, run_stream(...)Brokered JSON, Arrow IPC, Avro, Protobuf, or Debezium 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 eval --input debezium, blazerules_io.unwrap_debezium(...)Database change streams.
Arrow IPCblazerules eval --input arrow-ipc, blazerules_io.ArrowIpcDecoderBinary Arrow frames.
Avroblazerules eval --input avro, blazerules_io.AvroDecoder/decode_avro_ocf_file_eachSchema-based binary events; Object Container Files decode every record via auto-detected magic bytes.
Protobufblazerules eval --input protobuf|protobuf-delimited, blazerules_io.ProtobufDecoderDescriptor-backed binary events; protobuf-delimited decodes every varint-length-delimited message in a file.
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


Did this page help you?