rsyslox

High-performance REST API for rsyslog/MySQL written in Go.
π About
A modern REST API server that queries rsyslog data from a MySQL/MariaDB database and makes it accessible via HTTP/JSON. Perfect for monitoring dashboards, log analysis, and system integration.
π Features
- π High Performance - Compiled in Go for maximum speed
- π Advanced Filtering - Multi-value filters for complex queries
- π All Fields - Access to all 25+ SystemEvents columns
- π Secure - API key authentication, SSL/TLS support
- π³ Docker Ready - Complete test environment with live data
- π REST API - Clean JSON responses
- π― RFC-5424 Compliant - Proper syslog severity and facility labels
π Quick Start
Binary Installation (Recommended)
# Download latest release
wget https://github.com/phil-bot/rsyslox/releases/latest/download/rsyslox-linux-amd64
# Install
chmod +x rsyslox-linux-amd64
sudo mv rsyslox-linux-amd64 /usr/local/bin/rsyslox
# Create configuration
cat > .env << EOF
API_KEY=$(openssl rand -hex 32)
DB_HOST=localhost
DB_NAME=Syslog
DB_USER=rsyslog
DB_PASS=your-password
EOF
# Run
rsyslox
Test the API:
curl http://localhost:8000/health
curl -H "X-API-Key: YOUR_KEY" "http://localhost:8000/logs?limit=5"
Docker Test Environment
Perfect for testing with live generated logs:
# Build binary
make build-static
# Start container
cd docker && docker-compose up -d
# Test
curl "http://localhost:8000/logs?limit=5"
β Full Installation Guide
π Documentation
Getting Started
API & Usage
Administration
Development
β Full Documentation
π‘ Examples
Retrieve logs with filters
# All errors from the last hour
curl -H "X-API-Key: YOUR_KEY" \
"http://localhost:8000/logs?Priority=3&start_date=2025-02-09T09:00:00Z"
# Logs from multiple hosts (Multi-value!)
curl -H "X-API-Key: YOUR_KEY" \
"http://localhost:8000/logs?FromHost=web01&FromHost=web02&FromHost=db01"
# Combined filters
curl -H "X-API-Key: YOUR_KEY" \
"http://localhost:8000/logs?FromHost=web01&Priority=3&Priority=4&limit=20"
# All available hosts
curl -H "X-API-Key: YOUR_KEY" "http://localhost:8000/meta/FromHost"
# All priorities with labels
curl -H "X-API-Key: YOUR_KEY" "http://localhost:8000/meta/Priority"
# Hosts that had errors
curl -H "X-API-Key: YOUR_KEY" \
"http://localhost:8000/meta/FromHost?Priority=3&Priority=4"
β More Examples
π What's New in v0.2.3?
- β
Complete Modularization - Clean code architecture
- β
Structured Error Responses - Better API error handling
- β
DB Connection String Support - Flexible database configuration
- β
Multi-Value Filters - Multiple values per parameter
- β
Extended Columns - All 25+ SystemEvents fields
β Changelog
πΊοΈ Roadmap
v0.3.0 (Planned)
- Negation filters (
exclude, not)
- Advanced filter combinations
- Complex query support
v0.4.0 (Planned)
- Statistics endpoint (
/stats)
- Aggregations
- Timeline/Histogram
- WebUI integration
β GitHub Issues
π Contributing
Contributions are welcome! Please read the Contributing Guidelines.
- Fork the repository
- Create feature branch
- Make changes & add tests
- Submit pull request
π License
MIT License - see LICENSE for details.
β¨ Credits
Created with β€οΈ for the syslog community.
Built with:
β Star this project if it helps you!