logarithm

Self-learning diagnostics agent for GNU/Linux that uses unsupervised machine learning to detect anomalies in system logs in real-time.

Logarithm Banner

Logarithm: Anomaly Detection Agent

Pipeline Status Latest Release License: GPL v3 Crystal >= 1.21.0 Platform: GNU/Linux Donate with Liberapay

Logarithm is a self-learning diagnostics agent for GNU/Linux systems that uses unsupervised machine learning to detect anomalies in system logs in real-time.

Built with Crystal for bare-metal performance, memory safety, and native multithreading, Logarithm trains neural autoencoders and linear support vector machines (SVM) on normal log baselines to identify potential regressions, zero-day threats, and unusual system behaviors without requiring labeled datasets or heavy external dependencies.


Key Features

Capability Architecture Description
πŸ“‘ Multi-Source Ingestion JournaldLogSource / VarlogLogSource Simultaneous streaming from systemd-journald, syslog files, and piped standard input (stdin).
🧠 Unsupervised ML Engine Neural Autoencoder & One-Class SVM Real-time reconstruction error scoring with Adam optimization and hyper-plane boundary classification.
⚑ Bare-Metal Concurrency Execution Contexts & Sync::Mutex Non-blocking CSP channels and multithreaded worker pools delivering sub-millisecond inference latency.
πŸ’Ύ Bounded Memory Footprint ChunkedTrainingStorage File-backed batch rotation preserving $<50,\text{MB}$ RAM during training on datasets exceeding 100K+ logs.
πŸ”’ At-Rest Security AES-256-CBC & HMAC Verification Encrypted model serialization with cryptographic tampering detection and structured audit logging.
πŸ›‘οΈ Self-Healing Resilience Circuit Breakers & Health Probes Active health checks, exponential retry policies, and performance threshold monitors.
πŸ§ͺ Synthetic Simulation Suite fakelogs & Automated Demos Built-in synthetic log generator with configurable anomaly ratios and reproducible simulation scripts.

Quick Start

1. Build

git clone https://gitlab.com/renich/logarithm.git
cd logarithm
make setup
make release

2. Train

# Train on systemd journal for 1 hour
bin/logarithm train -j -t '1h'

# Train on flat log files
bin/logarithm train /var/log/syslog /var/log/messages -t '2h'

3. Monitor

# Monitor systemd journal in real-time
bin/logarithm monitor -j

# Monitor specific files with custom sensitivity threshold
bin/logarithm monitor -T 0.85 /var/log/secure

# Monitor piped input stream
tail -f /var/log/app.log | bin/logarithm monitor -i

Documentation

Comprehensive engineering, architectural, and operational manuals are available in docs/:

  • πŸ“– User Guide & Manual β€” Operator guides, deployment strategies, and runtime options.
  • πŸš€ Quickstart Guide β€” Step-by-step setup, training, and real-time monitoring walk-throughs.
  • πŸ§ͺ Fakelogs & Testing Guide β€” Generating synthetic logs, injecting anomalies, and running simulations.
  • πŸ“‹ Functional Specifications β€” Modular requirements ([FUNC-xxx]), ingestion modes, and ML behaviors.
  • πŸ—οΈ Technical Specifications β€” Internal subsystems ([TECH-xxx]), concurrency model, and storage engine.
  • βš™οΈ API & CLI Reference β€” Complete CLI flag catalog, YAML configuration schemas, and output formats.
  • πŸ›οΈ Architecture Decision Records β€” Architectural choices, trade-offs, and historical context.
  • πŸ—ΊοΈ Project Roadmap β€” Phased roadmap tracking and milestone definitions.

Development & Verification

Logarithm enforces a zero-defect quality gate across all subsystems:

make check        # Run full verification suite (specs, Ameba, Flaw SAST, crstlint)
make test         # Run 193-spec unit & property test suite
make lint         # Run Ameba static analysis and Flaw security scanner
make doc-check    # Verify reStructuredText formatting and syntax
make coverage     # Generate kcov test coverage report

Automated Simulations

/usr/bin/bash demo/demo_anomaly_detection.bash            # End-to-end anomaly detection pipeline demo
/usr/bin/bash demo/demo_chunked_training.bash             # Chunked storage & memory-efficient training demo
/usr/bin/bash integration/test.bash                       # Integration test suite
/usr/bin/bash benchmark/profile.bash                      # Throughput profiling suite

License & Authors

  • Software: GNU General Public License v3.0 (GPLv3)
  • Documentation: GNU Free Documentation License v1.3 (GFDL)
  • Code of Honor: Contributor standards defined in CODE_OF_HONOR.rst
  • Author: RΓ©nich Bon Δ†iriΔ‡ <renich@woralelandia.com> | woralelandia.com | EVALinux

Support & Donations

If you find Logarithm useful and wish to support its ongoing development, please consider donating:

Donate using Liberapay

Repository

logarithm

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 4
  • 9 days ago
  • September 14, 2025
License

GNU General Public License v3.0 or later

Links
Synced at

Wed, 09 Sep 2026 13:21:38 GMT

Languages