feat(monitoring): resolve Loki-stack syslog ingestion with rsyslog filter fix
Fixed critical issue preventing UniFi router logs from reaching Loki/Promtail/Grafana. Root Cause: - rsyslog filter in /etc/rsyslog.d/unifi-router.conf filtered for 192.168.1.1 - VM 101 on VLAN 2, actual source IP is 192.168.2.1 (VLAN 2 gateway) - Filter silently rejected all incoming syslog traffic Solution: - Updated rsyslog filter from 192.168.1.1 to 192.168.2.1 - Logs now flow: UniFi → rsyslog → Promtail → Loki → Grafana Changes: - Add services/loki-stack/* - Complete Loki/Promtail/Grafana stack configs - Add services/logward/* - Logward service configuration - Update troubleshooting/loki-stack-bugfix.md - Complete 5-phase resolution - Update CLAUDE_STATUS.md - Document 2025-12-11 resolution - Update sub-agents/scribe.md - Agent improvements - Remove services/promtail-config.yml - Duplicate file cleanup Status: ✅ Monitoring stack fully operational, syslog ingestion active Technical Details: See troubleshooting/loki-stack-bugfix.md for complete analysis 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
174
services/logward/docker-compose.yml
Normal file
174
services/logward/docker-compose.yml
Normal file
@@ -0,0 +1,174 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: timescale/timescaledb:latest-pg16
|
||||
container_name: logward-postgres
|
||||
environment:
|
||||
POSTGRES_DB: ${DB_NAME}
|
||||
POSTGRES_USER: ${DB_USER}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
command:
|
||||
- "postgres"
|
||||
- "-c"
|
||||
- "max_connections=100"
|
||||
- "-c"
|
||||
- "shared_buffers=256MB"
|
||||
- "-c"
|
||||
- "effective_cache_size=768MB"
|
||||
- "-c"
|
||||
- "work_mem=16MB"
|
||||
- "-c"
|
||||
- "maintenance_work_mem=128MB"
|
||||
# Parallel query settings for faster aggregations
|
||||
- "-c"
|
||||
- "max_parallel_workers_per_gather=4"
|
||||
- "-c"
|
||||
- "max_parallel_workers=8"
|
||||
- "-c"
|
||||
- "parallel_tuple_cost=0.01"
|
||||
- "-c"
|
||||
- "parallel_setup_cost=100"
|
||||
- "-c"
|
||||
- "min_parallel_table_scan_size=8MB"
|
||||
# Write-ahead log tuning for ingestion
|
||||
- "-c"
|
||||
- "wal_buffers=16MB"
|
||||
- "-c"
|
||||
- "checkpoint_completion_target=0.9"
|
||||
# Logging for slow queries (>100ms)
|
||||
- "-c"
|
||||
- "log_min_duration_statement=100"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- logward-network
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: logward-redis
|
||||
command: redis-server --requirepass ${REDIS_PASSWORD}
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "sh", "-c", "redis-cli -a $${REDIS_PASSWORD} ping | grep -q PONG"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- logward-network
|
||||
|
||||
backend:
|
||||
image: ${LOGWARD_BACKEND_IMAGE:-logward/backend:latest}
|
||||
container_name: logward-backend
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
DATABASE_URL: postgresql://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}
|
||||
DATABASE_HOST: postgres
|
||||
DB_USER: ${DB_USER}
|
||||
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
|
||||
API_KEY_SECRET: ${API_KEY_SECRET}
|
||||
PORT: 8080
|
||||
HOST: 0.0.0.0
|
||||
SMTP_HOST: ${SMTP_HOST:-}
|
||||
SMTP_PORT: ${SMTP_PORT:-587}
|
||||
SMTP_USER: ${SMTP_USER:-}
|
||||
SMTP_PASS: ${SMTP_PASS:-}
|
||||
SMTP_FROM: ${SMTP_FROM:-noreply@logward.local}
|
||||
INTERNAL_LOGGING_ENABLED: ${INTERNAL_LOGGING_ENABLED:-false}
|
||||
INTERNAL_API_KEY: ${INTERNAL_API_KEY:-}
|
||||
SERVICE_NAME: logward-backend
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- logward-network
|
||||
|
||||
worker:
|
||||
image: ${LOGWARD_BACKEND_IMAGE:-logward/backend:latest}
|
||||
container_name: logward-worker
|
||||
command: ["worker"]
|
||||
healthcheck:
|
||||
disable: true
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
DATABASE_URL: postgresql://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}
|
||||
DATABASE_HOST: postgres
|
||||
DB_USER: ${DB_USER}
|
||||
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
|
||||
API_KEY_SECRET: ${API_KEY_SECRET}
|
||||
SMTP_HOST: ${SMTP_HOST:-}
|
||||
SMTP_PORT: ${SMTP_PORT:-587}
|
||||
SMTP_USER: ${SMTP_USER:-}
|
||||
SMTP_PASS: ${SMTP_PASS:-}
|
||||
SMTP_FROM: ${SMTP_FROM:-noreply@logward.local}
|
||||
INTERNAL_LOGGING_ENABLED: ${INTERNAL_LOGGING_ENABLED:-false}
|
||||
INTERNAL_API_KEY: ${INTERNAL_API_KEY:-}
|
||||
SERVICE_NAME: logward-worker
|
||||
depends_on:
|
||||
backend:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- logward-network
|
||||
|
||||
frontend:
|
||||
image: ${LOGWARD_FRONTEND_IMAGE:-logward/frontend:latest}
|
||||
container_name: logward-frontend
|
||||
ports:
|
||||
- "3001:3001"
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PUBLIC_API_URL: ${PUBLIC_API_URL:-http://localhost:8080}
|
||||
depends_on:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- logward-network
|
||||
|
||||
fluent-bit:
|
||||
image: fluent/fluent-bit:latest
|
||||
container_name: logward-fluent-bit
|
||||
volumes:
|
||||
- ./fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf:ro
|
||||
- ./parsers.conf:/fluent-bit/etc/parsers.conf:ro
|
||||
- ./extract_container_id.lua:/fluent-bit/etc/extract_container_id.lua:ro
|
||||
- ./wrap_logs.lua:/fluent-bit/etc/wrap_logs.lua:ro
|
||||
- /var/lib/docker/containers:/var/lib/docker/containers:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
environment:
|
||||
LOGWARD_API_KEY: ${FLUENT_BIT_API_KEY:-}
|
||||
LOGWARD_API_HOST: backend
|
||||
depends_on:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- logward-network
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
driver: local
|
||||
redis_data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
logward-network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user