---
updatedAt: 2026-07-15T11:40:15.000Z
agentTools:
  projectIndex: https://docs.blazerules.dev/llms.txt
---

# Getting Started

Install the package, pick an input source, and run a first batch through BlazeRules.

BlazeRules runs YAML rules over event batches. Start by choosing how records enter the engine.

## Choose An Input Path

| Input                                     | Use                                                                              | Next page                                   |
| ----------------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------- |
| NDJSON bytes or JSON logs                 | `RuleEngine.evaluate_ndjson(...)` or `blazerules eval --input ndjson`            | [Quickstart](quickstart)                    |
| A top-level JSON array batch              | `RuleEngine.evaluate_json_array(...)` or `blazerules eval --input json-array`    | [Python API](python-api)                    |
| PyArrow / Arrow batches                   | `RuleEngine.evaluate_batch(...)`                                                 | [Python API](python-api)                    |
| Application logs over HTTP                | `blazerules_agent --input http`                                                  | [HTTP Logs](http-log-ingestion)             |
| Terminal, stdout, stderr, or service logs | `blazerules_agent --input stdin`                                                 | [stdin Logs](stdin-log-ingestion)           |
| A log file to follow                      | `blazerules_agent --input file_tail`                                             | [File Tail](file-tail-ingestion)            |
| Kubernetes pod logs                       | Helm chart / DaemonSet                                                           | [Kubernetes Logs](kubernetes-log-ingestion) |
| Kafka topics                              | `blazerules stream kafka`, or `blazerules_io` Kafka loop                         | [Kafka Streaming](kafka-streaming)          |
| Arrow IPC, Avro, or Protobuf              | `blazerules eval --input arrow-ipc\|avro\|protobuf`, or `blazerules_io` decoders | [Binary Formats](binary-format-ingestion)   |
| S3 or local files                         | `blazerules_io.read_*`                                                           | [S3 Resources](s3-rules-lookups-models)     |

All of these paths end at the same batch engine. The input adapter changes; rule semantics do not.

## Install

```bash
pip install blazerules
python -c "import blazerules, blazerules_io; print(blazerules.__version__, blazerules.simd_backend())"
```

The wheel also installs three command-line executables on the active `PATH`: `blazerules` (batch and stream operations), `blazerules_agent`, and `blazerules_dashboard`. Verify the installation with `blazerules info`.

## Minimal Rule

```yaml
schema_version: "2.1"
ruleset:
  name: app-log-rules
  version: "1.0.0"
  rules:
    - id: error_payment
      action: REVIEW
      conditions:
        and:
          - field: level
            op: eq
            value: error
          - field: message
            op: contains
            value: payment
```

Save it as `rules.yaml`.

## Evaluate NDJSON In Python

```python
import blazerules

engine = blazerules.RuleEngine()
engine.load_rules("rules.yaml")

payload = b"""
{"event_id":"e1","level":"info","message":"checkout started","amount":30}
{"event_id":"e2","level":"error","message":"payment failed","amount":900}
"""

result = engine.evaluate_ndjson(payload)
print(result.decisions)
print(result.match_counts)
```

<Accordion title="CLI equivalent: `blazerules eval`">

```bash
printf '%s\n' \
  '{"event_id":"e1","level":"info","message":"checkout started","amount":30}' \
  '{"event_id":"e2","level":"error","message":"payment failed","amount":900}' | \
  blazerules eval --rules rules.yaml --input ndjson --stdin --output decisions-jsonl
```

</Accordion>

<Accordion title="Agent equivalent: evaluate through the local agent">

```bash
printf '%s\n' \
  '{"event_id":"e1","level":"info","message":"checkout started","amount":30}' \
  '{"event_id":"e2","level":"error","message":"payment failed","amount":900}' | \
  blazerules_agent --rules rules.yaml --input stdin --output stdout
```

</Accordion>

## Run A Local HTTP Ingest Endpoint

```bash
blazerules_agent \
  --rules rules.yaml \
  --input http \
  --host 127.0.0.1 \
  --port 9480 \
  --batch-size 2048 \
  --flush-ms 100 \
  --output ndjson \
  --output-path decisions.ndjson
```

Send records:

```bash
curl -X POST http://127.0.0.1:9480/v1/logs \
  --data-binary $'{"event_id":"e2","level":"error","message":"payment failed","amount":900}\n'
```

<Accordion title="Python equivalent: send the same HTTP batch">

```python
import urllib.request

payload = b'{"event_id":"e2","level":"error","message":"payment failed","amount":900}\n'
urllib.request.urlopen("http://127.0.0.1:9480/v1/logs", data=payload).read()
```

</Accordion>

## Inspect Decisions

```bash
blazerules_dashboard \
  --decision-log decisions.ndjson \
  --dead-letter-log dead_letters.ndjson \
  --rules rules.yaml
```

Open `http://127.0.0.1:9470`.

## Where To Go Next

<Cards columns={2}>
  <Card title="Ingestion Overview" href="ingestion-overview" icon="fa-diagram-project">
    Every supported input type and where it fits.
  </Card>
  <Card title="Quickstart" href="quickstart" icon="fa-rocket">
    JSON and Arrow examples using the Python module.
  </Card>
  <Card title="HTTP Logs" href="http-log-ingestion" icon="fa-globe">
    POST NDJSON records to the local agent.
  </Card>
  <Card title="File Tail" href="file-tail-ingestion" icon="fa-file-lines">
    Tail application, stdout, stderr, or pod log files.
  </Card>
</Cards>