Features
Dashboard
Real-time overview of log statistics and system health.
Log Collection
Collect logs from rsyslog (UDP/TCP) and Docker containers.
AI Analysis
Analyze logs using a local Ollama LLM for intelligent insights.
Smart Alerts
Create filters to detect patterns and receive Telegram notifications.
Docker Integration
Auto-discover and monitor Docker container logs.
AI Chat
Interactive chat assistant for real-time log troubleshooting.
Modern UI
Clean, responsive interface inspired by oVirt/Foreman. Offline-capable — no CDN required.
Screenshots
Architecture
Quick Start
Docker Compose (Recommended)
git clone https://github.com/ftsiadimos/logaimonitor.git
cd logaimonitor
cp docker-compose.example.yml docker-compose.yml
# Edit docker-compose.yml — set SECRET_KEY, OLLAMA_HOST,
# TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID (or configure via the web UI later)
docker compose up -d
admin / password adminChange these immediately after first login.
Open http://localhost:5059.
Manual Installation
pip install -r requirements.txt
# Start Redis
docker run -d --name redis -p 6379:6379 redis:7-alpine
# Install Ollama and pull a model
curl -fsSL https://ollama.ai/install.sh | sh
ollama pull llama3.2
ollama serve
# Run the app
python app.py
Configuration
Environment variables can be set in docker-compose.yml or changed later via the web UI (Settings).
| Variable | Description | Default |
|---|---|---|
SECRET_KEY | Flask secret key | change-this |
REDIS_HOST | Redis hostname | localhost |
REDIS_PORT | Redis port | 6379 |
OLLAMA_HOST | Ollama API URL | http://localhost:11434 |
OLLAMA_MODEL | Ollama model name | llama3.2 |
TELEGRAM_BOT_TOKEN | Telegram bot token | — |
TELEGRAM_CHAT_ID | Telegram chat ID | — |
LOG_RETENTION_HOURS | Recent log retention (not a full history) | 2 |
ANALYSIS_INTERVAL_SECONDS | Auto-analysis interval | 300 |
Rsyslog Configuration
On each Linux server create /etc/rsyslog.d/99-logaimonitor.conf:
# Forward all logs via UDP
*.* @logaimonitor-host:5514
# Or via TCP (more reliable)
*.* @@logaimonitor-host:5515
sudo systemctl restart rsyslog
Forward Specific Logs Only
# Auth / security only
auth,authpriv.* @logaimonitor-host:5514
# Errors and above
*.err @logaimonitor-host:5514
# Kernel messages
kern.* @logaimonitor-host:5514
Test with logger
logger -n logaimonitor-host -P 5514 -d "Test message from server"
Docker Logs from External Hosts
Option 1 — Docker Syslog Logging Driver (Recommended)
docker run -d \
--log-driver=syslog \
--log-opt syslog-address=udp://logaimonitor-host:5514 \
--log-opt tag="{{.Name}}" \
your-image
Or set as default in /etc/docker/daemon.json:
{
"log-driver": "syslog",
"log-opts": {
"syslog-address": "udp://logaimonitor-host:5514",
"tag": "{{.Name}}"
}
}
sudo systemctl restart docker
Option 2 — Docker Remote API
Edit /etc/docker/daemon.json on the remote host:
{ "hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"] }
Then set DOCKER_SOCKET=tcp://remote-host:2375 on LogAI Monitor.
Option 3 — rsyslog on Remote Host
# /etc/rsyslog.d/99-docker-forward.conf
module(load="imjournal")
:programname, startswith, "docker" @logaimonitor-host:5514
Telegram Notifications
- Create a bot with @BotFather and copy the bot token.
- Send a message to your bot.
- Get your chat ID from
https://api.telegram.org/bot<TOKEN>/getUpdates. - Set
TELEGRAM_BOT_TOKENandTELEGRAM_CHAT_IDvia environment variables or the Settings page.
Usage
Creating Filters
- Go to Filters in the sidebar and click Create Filter.
- Configure conditions: Severity, Source Contains, Message Contains, or Message Regex.
- Enable Telegram notification if desired, then save.
AI Analysis
- Go to AI Analysis and click Analyze Recent Logs for a batch analysis.
- Use the Chat Assistant to ask questions about your logs.
- Click any log entry → Analyze with AI for a detailed breakdown.
Docker Containers
Go to Docker Containers in the sidebar to view all running containers, browse their logs, and trigger AI analysis per container.
API Reference
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/logs | Get logs with filtering |
| GET | /api/logs/<id> | Get single log |
| POST | /api/logs/ingest | Ingest log via HTTP |
| GET | /api/filters | List all filters |
| POST | /api/filters | Create filter |
| PUT | /api/filters/<id> | Update filter |
| DELETE | /api/filters/<id> | Delete filter |
| GET | /api/alerts | List alerts |
| POST | /api/alerts/<id>/acknowledge | Acknowledge alert |
| GET | /api/ollama/status | Check Ollama status |
| POST | /api/ollama/analyze | Analyze logs |
| POST | /api/ollama/chat | Chat with AI |
| GET | /api/settings | Get settings |
| POST | /api/settings | Save settings |
| POST | /api/telegram/test | Test Telegram connection |
Ports
| Port | Protocol | Description |
|---|---|---|
| 5059 | TCP | Web interface |
| 5514 | UDP | Syslog (UDP) |
| 5515 | TCP | Syslog (TCP) |
Tech Stack
Troubleshooting
Logs not appearing
- Check rsyslog configuration on source servers.
- Verify network connectivity on ports 5514/5515.
- Check firewall rules.
- View container logs:
docker compose logs -f logaimonitor
Ollama not working
- Verify Ollama is running:
curl http://localhost:11434/api/tags - Check the model is pulled:
ollama list - Verify the
OLLAMA_HOSTenvironment variable.
Telegram not sending messages
- Verify the bot token is correct.
- Check the chat ID — you must start a conversation with the bot first.
- Use Test Connection in Settings.