Self-contained reference programs that exercise sloth's external contracts. Each subdirectory is independent — no shared build, no shared dependencies.
| Path | What it shows |
|---|---|
consumer/ (Python 3, stdlib only) |
Reading sloth's read-only JSONL data socket (--data-socket SPEC). Connect, parse, filter, reconnect. The textbook consumer loop. |
forwarder/ (Python 3, stdlib only) |
Reference SIEM forwarder. Three sinks ship: Splunk HEC (HTTPS JSON envelopes), RFC 5424 syslog (UDP or TCP), and Elasticsearch Bulk API (NDJSON, time-rolled indices, basic auth or API key). Batching, retries with exponential backoff, drop-on-failure to match sloth's non-durable contract. Pluggable sink interface — ~30 lines per additional sink. |
stunnel/ (config templates) |
Mutual-TLS transport for the data socket when the reader can't speak SSH. sloth stays bound to loopback; stunnel owns the certificates and the handshake. Sensor-side and reader-side configs, plus the accept/connect mistake that fails open. |
These are out-of-product: they don't link to or modify sloth itself, and they don't ship with the binary. They live here so the schema and socket contract have a concrete, runnable companion that the next agent (or the next external integrator) can read as the worked example.
If you add an example: keep it stdlib-only where possible (consumers should not need a build environment to follow sloth), include a self-contained README, and link it from this table.