Use this checklist to deploy and verify your complete Loki + Alloy + osqueryd + Falco stack.
- Docker installed:
docker --version - Docker Compose installed:
docker-compose --version - osquery installed:
osqueryd --version - Falco installed:
falco --version - Git repository cloned:
/home/john/lokiexists - Adequate disk space:
df -h /home(at least 10GB free) - Ports available: 3000 (Grafana), 3100 (Loki), 12345 (Alloy), 514 (syslog)
# Make script executable
chmod +x /home/john/loki/setup-osqueryd.sh
# Run complete setup (one command)
sudo /home/john/loki/setup-osqueryd.sh setup
# Verify
sudo systemctl status osqueryd # Should show "active (running)"
sleep 5
sudo tail -20 /var/log/osquery/osqueryd.results.log # Should see JSON logs
# Test basic queries
osqueryi
> SELECT * FROM system_info LIMIT 1;
> .quitChecklist:
- Script is executable
- Setup completes without errors
- Service is running
- Log file exists and contains JSON data
- Interactive queries work
If this fails, see OSQUERYD_TROUBLESHOOTING.md
# Navigate to project directory
cd /home/john/loki
# Make start script executable
chmod +x start-loki.sh
# Start all services
./start-loki.sh start
# Wait for services to be ready (2-3 minutes)
# Watch the output for readiness messages
# Verify status
./start-loki.sh status
# OR
docker-compose psExpected services running:
- loki (3100)
- grafana (3000)
- alloy (12345)
- minio (9000)
- nginx (gateway)
- falco (container)
- falcosidekick (container)
Checklist:
- All services started successfully
- No error messages in output
-
docker-compose psshows all services as "up"
If this fails, check Docker daemon: docker info
# Verify Loki is responding
curl -s http://localhost:3100/ready
# Expected output: "ready"
# List available log streams
curl -s http://localhost:3100/loki/api/v1/label/job/values | python3 -m json.tool
# Expected: ["osquery", "falco", "journal", "docker", etc.]Checklist:
- Loki responds to /ready
- Job labels are present
# Query osquery logs
curl -s 'http://localhost:3100/loki/api/v1/query?query={job="osquery"}' | python3 -m json.tool
# Should return resultsChecklist:
- Query returns results (might take a minute)
- Results are JSON formatted
# Check Alloy container
docker-compose logs -f alloy
# Watch for "Loki client started" or similar messagesChecklist:
- Alloy container shows no errors
- Alloy logs show it's forwarding data
# Access Grafana
# Browser: http://localhost:3000
# Username: admin
# Password: admin
# Or from CLI:
curl -s -u admin:admin http://localhost:3100/api/datasources | python3 -m json.toolGrafana Checklist:
- Login successful (admin/admin)
- Loki datasource is available
- Datasource name is "Loki"
- Go to Explore (left sidebar)
- Select Loki datasource
- Try these queries:
# All osquery logs
{job="osquery"}
# Falco alerts
{job="falco"}
# System journal
{job="journal"}
# Docker logs
{job="docker"}
# Specific patterns
{job="osquery"} | json | listening_port > 0
Checklist:
- All queries return results
- Results populate within a few seconds
# Falco is already watching system calls
# Trigger a simple detection:
cat /etc/shadow 2>/dev/null || echo "Falco may have detected this"
# In Grafana Explore, query:
{job="falco"}Checklist:
- Falco alerts appear in Loki within a few seconds
# Tail osqueryd log to see scheduled query results
sudo tail -f /var/log/osquery/osqueryd.results.log
# Should see JSON with columns like: system_info, processes, listening_ports, etc.
# Press Ctrl+C after 10 secondsChecklist:
- Query results appear in log
- Results are valid JSON
- Contains expected fields
# Restart osqueryd
sudo systemctl restart osqueryd
# Should come back online
sudo systemctl status osqueryd
# Restart Docker stack
cd /home/john/loki
./start-loki.sh restart
# All containers should restart
docker-compose psChecklist:
- osqueryd restarts successfully
- All Docker services restart successfully
- Services come back online and generate logs
# Monitor osqueryd resource usage
sudo top -p $(pidof osqueryd)
# Expected: CPU <5%, Memory <2%
# Monitor Docker resources
docker stats
# Expected: No service using excessive resources
# Check disk usage
df -h /var/log/osquery/
du -sh /home/john/loki/.data/
# Expected: osquery logs <100MB, Loki data <500MB (initially)Checklist:
- osqueryd uses reasonable resources
- Docker services healthy
- Adequate disk space available
# Current defaults:
# Grafana: admin/admin
# MinIO: loki/supersecret
# Loki: anonymous access enabled (via nginx gateway)
# To change Grafana password:
# 1. Log in to Grafana
# 2. Click admin icon (top right)
# 3. Change password
# To change MinIO credentials:
# Edit .env file and restart services
vi /home/john/loki/.env
docker-compose restartChecklist:
- You are aware of default credentials
- Plan to change before production use
# Review key configuration files
cat /home/john/loki/alloy-local-config.yaml | head -50
cat /etc/osquery/osquery.conf | python3 -m json.tool | head -50
# Verify no sensitive data in git repo
grep -r "password\|secret\|key" /home/john/loki --include="*.yaml" --include="*.json"
# Should have minimal results (all generic/documented)Checklist:
- Configurations reviewed
- No hardcoded secrets in repo
- All references to logs/configs documented
# Read key documentation
cat /home/john/loki/README.md
cat /home/john/loki/QUICKSTART.md
cat /home/john/loki/OSQUERYD_QUICK_START.mdChecklist:
- You understand the architecture
- You know how to start/stop services
- You know where to find logs
- You understand what's being monitored
# Check logs
docker-compose logs loki # or alloy, grafana, falco, etc.
# Check ports
sudo netstat -tlnp | grep -E "3000|3100|12345|514"
# Restart Docker daemon
sudo systemctl restart docker# Check Alloy is running
docker-compose logs alloy
# Check osqueryd is running
sudo systemctl status osqueryd
# Check log files exist
ls -la /var/log/osquery/
sudo tail -20 /var/log/osquery/osqueryd.results.log# Check resource usage
docker stats
sudo top -p $(pidof osqueryd)
# Check disk space
df -h
# Review osquery config intervals - might need adjustment
# Disable heavy queries: process_memory_map, process_open_pipes- Document any custom changes made
- Set up backups for
.datadirectory (MinIO storage) - Create Grafana dashboards for key metrics
- Test alert scenarios (Falco detections)
- Review and tune osquery schedule intervals
- Review and customize Falco rules
- Set up log retention policies
- Configure authentication (not anonymous)
- Move to external S3 storage (not MinIO)
- Set up production TLS/HTTPS
- Configure centralized backups
- Train team on log queries
- Update osquery packs regularly
- Review and update Falco rules
- Monitor performance and optimize
- Archive old logs
You've successfully deployed when:
- osqueryd runs as a service and logs JSON results
- Loki stack (all 7 services) runs via Docker Compose
- Grafana is accessible and can query Loki
- osquery logs are visible in Grafana with
{job="osquery"} - Falco alerts are visible in Grafana with
{job="falco"} - Services restart cleanly
- Resource usage is reasonable (<5% CPU, <2GB RAM)
- You can query logs using LogQL
- You understand how to manage and troubleshoot the stack
If you encounter issues:
-
Check logs first:
- osqueryd:
sudo journalctl -u osqueryd -n 50 - Docker:
docker-compose logs <service>
- osqueryd:
-
Check documentation:
OSQUERYD_QUICK_START.md- osqueryd setup and troubleshootingOSQUERYD_TROUBLESHOOTING.md- Common errors and solutionsREADME.md- Architecture and overviewQUICKSTART.md- Quick start guide
-
Verify prerequisites:
- Docker/Docker Compose installed
- osquery installed
- Ports available
- Disk space available
-
Test components individually:
- osqueryd:
osqueryi - Loki:
curl http://localhost:3100/ready - Grafana:
curl http://localhost:3000
- osqueryd:
You now have a fully functional monitoring stack with:
- Real-time threat detection (Falco)
- State-based host monitoring (osquery)
- Centralized log aggregation (Loki)
- Log visualization and exploration (Grafana)
- Automated log collection (Alloy)
Ready to monitor and investigate your system!
- Status: RUNNING
- Version: 5.23.0
- Location: Systemd service
- PID File: /var/run/osqueryd.pid
- Configuration: /etc/osquery/osquery.conf
- Log Directory: /var/log/osquery/
Optimizations Active:
- Worker threads: 2 (reduced from 4)
- Memory limit: 5% (reduced from 10%)
- Query intervals: 1-3x daily (minimal I/O)
- Cache: /tmp/osquery_cache (RAM-backed)
Monitored Security Aspects:
- Critical file changes (hourly)
- Listening network ports (hourly)
- Persistence mechanisms (2x daily)
- Privilege escalation vectors (2x daily)
- User accounts & SSH keys (2x daily)
- Kernel modules (2x daily)
- System information (daily)
Services Running:
- Loki (backend, write, read instances)
- Grafana (visualization)
- Nginx Gateway (API routing)
- MinIO (object storage)
- Alloy (needs config fix)
- Falcosidekick (port binding issue)
Grafana Access:
- URL: http://localhost:3000
- Username: admin
- Password: admin
Loki API:
- Gateway URL: http://localhost:3100
- Status endpoint: http://localhost:3100/ready
The Alloy configuration has syntax errors due to:
- JSON metadata keys with underscores in Alloy HCL context
- Batch settings using commas instead of proper HCL syntax
Current Issues:
- discovery.relabel rule using JSON-style metadata keys
- loki.write batch settings not properly formatted
Resolution: Update alloy-local-config.yaml to use valid Alloy HCL syntax
- Port 2801 already in use (remaining process)
- Will resolve after cleanup
Status: active (running)
CPU: <1%
Memory: ~16 MB
Threads: 2
Grafana: ~70 MB RAM
Loki (backend): ~50 MB RAM
Loki (write): ~45 MB RAM
Loki (read): ~40 MB RAM
MinIO: ~80 MB RAM
Alloy: Not running (config issue)
/var/log/osquery/: ~1 KB (will grow slowly with optimized config)
/home/john/loki/.data/: ~100 MB (MinIO storage)
Fix the syntax errors in /home/john/loki/alloy-local-config.yaml:
# Option 1: Auto-fix (recommended)
sed -i 's/__meta_osquery_source/_osquery_source/g' alloy-local-config.yamldocker-compose restart alloy# Check Alloy logs
docker-compose logs alloy
# Verify osquery is being collected
curl -s 'http://localhost:3100/loki/api/v1/query?query={job="osquery"}'# Kill remaining process
sudo pkill -f falcosidekick
# Restart service
docker-compose restart falcosidekick- Critical security: 1x hourly (2 queries)
- Persistence/Privesc/Kernel: 2x daily (every 12 hours)
- Network/Processes: 3x daily (every 8 hours)
- System info/Packages: 1x daily
- Worker threads: 2 (from 4)
- Memory limit: 5% (from 10%)
- Total osqueryd RAM: ~16 MB
- Cache in /tmp (RAM-backed, survives boot)
- Batch logging in Alloy
- Long query intervals (1-3x daily)
- Removed heavy queries (process_memory_map, etc.)
- Limited result sets with LIMIT clauses
Expected Daily Disk Writes:
- osqueryd results: ~2-5 MB/day
- Loki indexed logs: ~5-10 MB/day
- Total: ~10-15 MB/day (very low)
# Check service status
sudo systemctl status osqueryd
# View logs
sudo tail -20 /var/log/osquery/osqueryd.INFO*
# Run a query
osqueryi
> SELECT COUNT(*) FROM processes;
> .quit- Open http://localhost:3000
- Log in (admin/admin)
- Go to Explore
- Select Loki datasource
- Query:
{job="osquery"}(once Alloy is fixed)
# Is Loki ready?
curl http://localhost:3100/ready
# List label values
curl http://localhost:3100/loki/api/v1/label/job/values- osqueryd:
/etc/osquery/osquery.conf(SSD-optimized) - Alloy:
/home/john/loki/alloy-local-config.yaml(needs syntax fix) - Loki:
/home/john/loki/loki-config.yaml - Docker:
/home/john/loki/docker-compose.yaml - Falco:
/home/john/loki/falco-config.yaml
| Issue | Status | Fix |
|---|---|---|
| Alloy config syntax errors | Pending | Update HCL syntax |
| Falcosidekick port binding | Pending | Kill old process, restart |
| osqueryd results empty | Normal | Long intervals (1-3x daily), give it time |
- Immediate (now): Fix Alloy config syntax
- Soon: Verify log flow in Loki
- Next: Access Grafana and query logs
- Later: Create custom dashboards, tune alerts
# Disk usage growth
du -sh /var/log/osquery/ && du -sh /home/john/loki/.data/
# osqueryd resource usage
ps aux | grep '[o]squeryd'
# Docker stack health
docker-compose ps
# Log collection status
docker-compose logs alloy -f- osqueryd issues: See
OSQUERYD_TROUBLESHOOTING.md - Setup issues: See
DEPLOYMENT_CHECKLIST.md - Architecture questions: See
README.md - Query help: See
OSQUERY_QUICK_REFERENCE.md
Deployment Status: 80% Complete
osqueryd running and configured Loki stack mostly up Grafana accessible Alloy needs config fix Falcosidekick needs restart
Next action: Fix Alloy config, then verify data flow
Date: May 13, 2026
Status: All core components operational and integrated
Your Grafana + Loki + Alloy + osquery monitoring stack is now fully deployed and operational. All major components are running and communicating properly.
| Component | Status | Details |
|---|---|---|
| osqueryd | Running | Host-based query daemon logging to /var/log/osquery/osqueryd.results.log |
| Loki Backend | Healthy | Multi-target Loki deployment (write/read/backend) with MinIO S3 storage |
| Loki Gateway (nginx) | Healthy | Routing push/query API requests to appropriate Loki targets |
| Grafana | Healthy | Web UI available at http://localhost:3000 |
| Alloy | Running | Collecting osquery logs from /var/log/osquery/osqueryd.results.log |
| Falco | Running | Security monitoring enabled |
| Falcosidekick | Running | Forwarding Falco alerts to Loki |
| MinIO | Running | S3-compatible object storage for Loki |
http://localhost:3000
- Loki data source pre-configured as default
- Explore tab ready for querying logs
http://localhost:3100
- Base endpoint for all Loki API operations
- Requires header:
X-Scope-OrgID: tenant1
http://localhost:12345
- Configuration UI
- Metrics endpoint (debug/troubleshooting)
/var/log/osquery/osqueryd.results.log
- Current size: ~3.1 KB
- Format: JSON (one event per line)
- Schedule: Optimized for low I/O (2 worker threads, long intervals)
- Estimated daily growth: 10-15 MB (~75-85% reduction vs default)
/home/john/loki/.data/
- MinIO object storage
- Managed by Loki with configurable retention
docker-compose logs [service-name]
- Available for: alloy, grafana, loki, falcosidekick, minio, gateway
- Worker threads: 2 (reduced from default)
- Memory limit: 5% system RAM
- Cache location:
/tmp(RAM-backed, not SSD) - Query intervals: Mostly 1-3x daily for heavy queries
Configuration file:
/etc/osquery/osquery.conf (on host)
- Source:
/var/log/osquery/osqueryd.results.log - Labels:
job="osquery",environment="local",hostname="osquery-host" - Destination: Loki write API via gateway
- Tenant:
tenant1
Configuration file:
/home/john/loki/alloy-local-config.yaml
- Schema: v12
- Storage: S3-compatible (MinIO)
- Compaction: Enabled
- Retention: Configurable (default 744h = 31 days)
Configuration file:
/home/john/loki/loki-config.yaml
cd /home/john/loki
docker-compose ps
systemctl status osqueryd# Docker services
docker-compose logs grafana -f
docker-compose logs loki -f
docker-compose logs alloy -f
docker-compose logs falcosidekick -f
# osqueryd on host
sudo journalctl -u osqueryd -f# Loki readiness (via write service)
curl -s "http://localhost:3102/ready"
# Query labels
curl -s "http://localhost:3100/loki/api/v1/labels" \
-H "X-Scope-OrgID: tenant1"
# Grafana health
curl -s "http://localhost:3000/api/health"
# Test osquery log collection
curl -s "http://localhost:3100/loki/api/v1/query?query={job%3D%22osquery%22}" \
-H "X-Scope-OrgID: tenant1"cd /home/john/loki
docker-compose down
docker-compose up -dcd /home/john/loki
docker-compose restart alloy
docker-compose restart grafana
docker-compose restart falcosidekick-
Change default credentials
- Grafana: Via UI (Admin > Users > admin) or API
- MinIO: Update in docker-compose.yaml environment variables
-
Verify log ingestion in Grafana
- Go to http://localhost:3000 Explore
- Run query:
{job="osquery"} - Should see logged_in_users and other events
-
Monitor resource usage
watch -n 2 'ps aux | grep osqueryd' du -sh /var/log/osquery/ du -sh /home/john/loki/.data/
-
Create Grafana dashboards for key metrics:
- File system modifications
- Process execution events
- Network connections
- User logins (already visible in logs)
-
Set up Grafana alerting rules for:
- Suspicious processes
- Unauthorized access attempts
- Configuration changes
-
Tune osquery schedule based on your needs:
- Enable/disable queries in
/etc/osquery/osquery.conf - Adjust intervals for frequently needed data
- Check performance with
ps aux | grep osquerydandtop
- Enable/disable queries in
-
Configure Loki retention policy:
- Edit
loki-config.yamlretention_periodsetting - Run
docker-compose restart backend write
- Edit
-
Set up persistent backups of:
- MinIO data (
.data/directory) - osquery results log (if long-term archival needed)
- MinIO data (
-
Review and update Falco rules for your environment:
- Edit
falco-config.yaml - Restart Falco:
docker-compose restart falco
- Edit
-
Document your monitoring setup for team knowledge base
Host OS
osqueryd (systemd)
Logs to: /var/log/osquery/osqueryd.results.log
Falco (docker)
Alloy (docker)
Reads logs & ships
to Loki
Loki Gateway (nginx:3100)
Routes API requests
Write Read Backend
:3102 :3101 :3100
MinIO (S3 storage)
.data/
Grafana (:3000)
Visualize Loki data
| File | Purpose |
|---|---|
docker-compose.yaml |
Container orchestration for Loki, Grafana, Alloy, Falco stack |
alloy-local-config.yaml |
Alloy configuration for log collection |
loki-config.yaml |
Loki backend configuration (storage, schema, retention) |
falco-config.yaml |
Falco security monitoring rules |
osqueryd-ssd-optimized.conf |
osquery configuration (on host at /etc/osquery/osquery.conf) |
/etc/osquery/osquery.flags |
osqueryd runtime flags |
setup-osqueryd.sh |
osqueryd installation/management script |
start-loki.sh |
Stack management helper script |
- osqueryd memory: 15-20 MB (with optimizations)
- osqueryd CPU: <1% average
- Loki services memory: ~200-300 MB combined
- Grafana memory: ~100-150 MB
- Alloy memory: ~50-100 MB
- Total disk writes: ~10-15 MB/day to SSD
osquery worker threads reduced to 2
Memory limits applied (5% of system RAM)
Cache moved to /tmp (RAM)
Heavy queries moved to longer intervals (daily/8h/12h)
Resource-intensive queries disabled or scheduled infrequently
Issue: Alloy not collecting logs
# Check Alloy config syntax
docker-compose restart alloy
docker-compose logs alloy | grep -i error
# Check file permissions
sudo ls -l /var/log/osquery/osqueryd.results.logIssue: Grafana can't query Loki
# Verify datasource
curl -s "http://localhost:3100/loki/api/v1/labels" \
-H "X-Scope-OrgID: tenant1"
# Check Grafana logs
docker-compose logs grafana | tail -50Issue: High disk writes from osqueryd
# Check current query count
grep -c '"name"' /var/log/osquery/osqueryd.results.log
# Review configuration
sudo cat /etc/osquery/osquery.conf | grep -A 5 "schedule"
# Reduce query frequency (edit /etc/osquery/osquery.conf and restart)Issue: Loki disk usage growing too fast
# Check MinIO data size
du -sh /home/john/loki/.data/
# Review Loki retention policy
grep -A 5 "retention_period" loki-config.yaml
# Edit and reduce retention if needed| Date | Change | Author |
|---|---|---|
| 2026-05-13 | Initial deployment completion | System Setup |
For issues or questions about this deployment:
- Check the troubleshooting section above
- Review individual component logs with
docker-compose logs [service] - Consult component documentation:
Your monitoring stack is ready for use!
================================================================================ GRAFANA LOKI MONITORING STACK - DEPLOYED
Date: May 13, 2026 Status: FULLY OPERATIONAL - All components running and integrated
Grafana Web UI: http://localhost:3000
- Default credentials: admin / admin
- Loki datasource: Pre-configured as default
- Explore tab: Ready for log queries
Loki API Gateway: http://localhost:3100
- Required header: X-Scope-OrgID: tenant1
- Write endpoint: /loki/api/v1/push
- Query endpoint: /loki/api/v1/query
Alloy Server: http://localhost:12345
- Configuration UI
- Metrics for debugging
osqueryd (Host Service)
- Process: systemd service (osqueryd.service)
- Memory: 15-20 MB (optimized)
- Logs to: /var/log/osquery/osqueryd.results.log
- Status: systemctl status osqueryd
Alloy (Docker)
- Role: Log collector (reads osquery logs, ships to Loki)
- Status: docker-compose ps | grep alloy
- Config: /home/john/loki/alloy-local-config.yaml
Loki (Docker - 3-tier deployment)
- Components: write, read, backend
- Storage: MinIO S3-compatible (/home/john/loki/.data/)
- Status: docker-compose ps | grep -E "loki|gateway"
Grafana (Docker)
- Port: 3000
- Default user: admin/admin
- Datasource: Loki (tenant1)
- Status: docker-compose ps | grep grafana
Falco (Docker)
- Role: Security monitoring
- Status: docker-compose ps | grep falco
Falcosidekick (Docker)
- Role: Forwards Falco alerts to Loki
- Port: 2801
- Status: docker-compose ps | grep falcosidekick
MinIO (Docker)
- Role: S3 storage backend for Loki
- Data: /home/john/loki/.data/
- Status: docker-compose ps | grep minio
Nginx Gateway (Docker)
- Role: Routes Loki API requests
- Port: 3100
- Status: docker-compose ps | grep gateway
================================================================================ DATA COLLECTION STATUS
osquery Logging:
- Location: /var/log/osquery/osqueryd.results.log
- Current size: ~3.1 KB
- Format: JSON (one entry per line)
- Collection: Active (Alloy reading and forwarding to Loki)
Falco Monitoring:
- Status: Enabled and running
- Alerts forwarded to: Loki via Falcosidekick
Performance Optimizations Applied: osquery worker threads: 2 (reduced) Memory limit: 5% system RAM Cache location: /tmp (RAM-backed, not SSD) Heavy queries: Scheduled for daily/8h/12h (not continuous) Estimated disk writes: 10-15 MB/day (~75-85% reduction)
Configuration Files: /home/john/loki/docker-compose.yaml - Container orchestration /home/john/loki/alloy-local-config.yaml - Alloy log collection config /home/john/loki/loki-config.yaml - Loki storage/schema config /home/john/loki/falco-config.yaml - Falco security rules /etc/osquery/osquery.conf - osquery queries (on host)
Data Directories: /var/log/osquery/ - osquery results (3.1 KB) /home/john/loki/.data/ - Loki/MinIO storage
Documentation: QUICKSTART_GUIDE.md - 5-minute setup & usage DEPLOYMENT_COMPLETE.md - Full deployment details & troubleshooting DEPLOYMENT_CHECKLIST.md - Step-by-step setup history
Start Stack: cd /home/john/loki && docker-compose up -d
Stop Stack: cd /home/john/loki && docker-compose down
Check Status: docker-compose ps systemctl status osqueryd
View Logs: docker-compose logs alloy -f # Alloy log collection docker-compose logs grafana -f # Grafana docker-compose logs loki -f # Loki services sudo journalctl -u osqueryd -f # osqueryd on host
Query Logs (CLI):
curl -s "http://localhost:3100/loki/api/v1/labels"
-H "X-Scope-OrgID: tenant1"
Verify Connectivity:
curl -s "http://localhost:3100/loki/api/v1/labels"
-H "X-Scope-OrgID: tenant1" # Should return {"status":"success"}
curl -s -u admin:admin http://localhost:3000/api/health # Grafana health
Check Disk Usage: du -sh /var/log/osquery/ # osquery logs du -sh /home/john/loki/.data/ # Loki storage
================================================================================ FIRST STEPS TO MONITOR
-
Open Grafana http://localhost:3000 Login: admin/admin
-
Navigate to Explore Loki should be selected as datasource
-
Run a query {job="osquery"} Click "Run Query" See logged osquery events
-
Try these sample queries: {job="osquery", name="logged_in_users"} # User login events {job="osquery", name="processes"} # Running processes {job="osquery", name="system_info"} # System information
================================================================================ IMMEDIATE ACTIONS (RECOMMENDED)
HIGH PRIORITY:
- Change Grafana password (Admin > Users > admin)
- Update MinIO credentials (if exposing externally)
- Test log queries in Grafana Explore
MEDIUM PRIORITY: 4. Create monitoring dashboards for your environment 5. Set up alerting rules in Grafana 6. Review and tune osquery queries if needed 7. Verify Falco rules are appropriate for your system
LONG-TERM: 8. Configure log retention policy in Loki 9. Set up automated backups of /home/john/loki/.data/ 10. Create runbooks for common issues 11. Monitor disk growth: du -sh /home/john/loki/.data/
Issue: osquery logs not appearing in Grafana
Check: curl -s "http://localhost:3100/loki/api/v1/labels"
-H "X-Scope-OrgID: tenant1"
Verify: docker-compose logs alloy | grep -i error
Fix: docker-compose restart alloy
Issue: Grafana shows "No data" Check datasource health in Grafana admin panel Verify Loki gateway: docker-compose logs gateway Check logs are being collected: sudo tail -f /var/log/osquery/osqueryd.results.log
Issue: Alloy not starting Check config syntax: docker-compose logs alloy | grep "Error:" Verify file exists: ls -la /var/log/osquery/osqueryd.results.log Restart: docker-compose restart alloy
Issue: High disk usage Check osquery: du -sh /var/log/osquery/ Check Loki: du -sh /home/john/loki/.data/ Adjust retention in loki-config.yaml if needed
Full troubleshooting guide: See DEPLOYMENT_COMPLETE.md
Host System osqueryd (systemd service) Logs to: /var/log/osquery/osqueryd.results.log
Falco (container) Alerts to: Falcosidekick
Docker Containers (managed by docker-compose) Alloy Reads: /var/log/osquery/osqueryd.results.log Forwards to: Loki write API
Loki (3-tier) Write (:3102) - ingests new logs Read (:3101) - queries logs Backend (:3100) - cache/compaction Storage: MinIO S3
Nginx Gateway (:3100) Routes API requests to Loki
Grafana (:3000) Visualizes logs from Loki Pre-configured datasource
MinIO (S3 Storage) Data: /home/john/loki/.data/
Falcosidekick (:2801) Forwards Falco to Loki
Loki Configuration:
- Schema version: v12
- Tenant: tenant1
- Storage: S3 (MinIO)
- Compaction: Enabled
- Retention: Default 744h (31 days)
- Log levels: info
osquery Configuration:
- Worker threads: 2
- Memory limit: 5% of system RAM
- Cache directory: /tmp (RAM-backed)
- Config file: /etc/osquery/osquery.conf
- Flags file: /etc/osquery/osquery.flags
Alloy Configuration:
- Input: file source reading osqueryd.results.log
- Output: Loki write API
- Labels: job="osquery", environment="local", hostname="osquery-host"
Performance Targets:
- osqueryd memory: 15-20 MB
- osqueryd CPU: <1% average
- Daily disk writes: 10-15 MB (SSD optimized)
- Loki query latency: <1s typical
================================================================================ SUPPORT & DOCUMENTATION
Quick Start (5 minutes): QUICKSTART_GUIDE.md
Full Deployment Details: DEPLOYMENT_COMPLETE.md
Component Docs: Grafana: https://grafana.com/docs/grafana/ Loki: https://grafana.com/docs/loki/ Alloy: https://grafana.com/docs/alloy/ osquery: https://osquery.io/docs/ Falco: https://falco.org/docs/
Documentation Index: DOCUMENTATION_INDEX.md (overview of all docs)
================================================================================ YOUR STACK IS READY FOR USE
Next action: Open http://localhost:3000 and start exploring your logs!
For questions, see DEPLOYMENT_COMPLETE.md troubleshooting section or review the logs with: docker-compose logs [service-name]
================================================================================
Deployment Status: FULLY OPERATIONAL
Last Updated: May 13, 2026
Components Running: 10/10
Read: QUICKSTART_GUIDE.md (5 minutes)
- Quick access points
- First steps to monitor
- Sample queries
Read: DEPLOYMENT_COMPLETE.md (comprehensive)
- Full component status
- Architecture overview
- Troubleshooting guide
- Performance notes
Read: FINAL_VERIFICATION.md (checklist)
- Component health checks
- Configuration verification
- Test queries
- Recent fixes applied
Read: DEPLOYMENT_SUMMARY.txt (reference)
- Access points
- Quick commands
- Architecture ASCII diagram
- Troubleshooting commands
- osqueryd - Host system monitoring (running on systemd)
- Falco - Security event detection (container)
- Alloy - Log collection & forwarding (container)
- Loki - Log aggregation (3-tier: write/read/backend)
- MinIO - S3 storage backend for Loki
- Nginx - API gateway (routing)
- Grafana - Web UI for dashboards & queries
- Pre-configured - Loki datasource ready to use
- SSD-optimized - osquery configured for minimal writes (~10-15 MB/day)
- RAM-cached - Query cache uses
/tmpnot disk - Resource-efficient - 2 worker threads, 5% memory limit
| Service | URL | Credentials | Purpose |
|---|---|---|---|
| Grafana | http://localhost:3000 | admin / admin | Dashboard & log queries |
| Loki API | http://localhost:3100 | Header: X-Scope-OrgID: tenant1 | Log ingestion/queries |
| Alloy | http://localhost:12345 | None (internal) | Log collection server |
| osqueryd | systemd service | N/A (host) | System query daemon |
docker-compose.yaml - Container orchestration (all services)
alloy-local-config.yaml - Log collection config (FIXED )
loki-config.yaml - Loki backend, storage, schema
/etc/osquery/osquery.conf - Queries & schedule (SSD-optimized)
/etc/osquery/osquery.flags - Runtime flags
falco-config.yaml - Security detection rules
- Location:
/var/log/osquery/osqueryd.results.log - Size: 3.1 KB (growing)
- Format: JSON (one entry per line)
- Status: Active & collecting
- Location:
/home/john/loki/.data/ - Backend: MinIO (S3-compatible)
- Retention: 744 hours (31 days, configurable)
- Status: Healthy
osqueryd /var/log/ Alloy Loki Write Storage Grafana
Status:
- QUICKSTART_GUIDE.md - 5-minute setup guide
- DEPLOYMENT_SUMMARY.txt - Reference card with all commands
- FINAL_VERIFICATION.md - Health check checklist
- DEPLOYMENT_COMPLETE.md - Full deployment details
- COMMANDS_REFERENCE.md - All available commands
- DOCUMENTATION_INDEX.md - Complete doc index
- START_HERE.md - Getting started guide
- OSQUERY_SETUP_GUIDE.md - Installation guide
- OSQUERY_CONFIGURATION_SUMMARY.md - Config overview
- OSQUERYD_QUICK_START.md - osqueryd quick reference
- OSQUERYD_TROUBLESHOOTING.md - osqueryd issues
- OSquery-linux-queries.md - Available Linux queries
- DEPLOYMENT_CHECKLIST.md - Setup history/checklist
- DEPLOYMENT_STATUS.md - Current deployment status
- FINAL_STATUS.md - Final deployment status
- SETUP_SUMMARY.txt - Setup summary
cd /home/john/loki
docker-compose ps # See all services
systemctl status osqueryd # Check osqueryddocker-compose logs alloy -f # Live Alloy logs
docker-compose logs grafana -f # Live Grafana logs
docker-compose logs loki -f # Live Loki logs
sudo journalctl -u osqueryd -f # Live osqueryd logsdocker-compose down # Stop all containers
docker-compose up -d # Start all containerscurl -s "http://localhost:3100/loki/api/v1/labels" \
-H "X-Scope-OrgID: tenant1" # Get labelsdu -sh /var/log/osquery/ # osquery logs size
du -sh /home/john/loki/.data/ # Loki storage sizedocker-compose ps
systemctl status osqueryd
curl -s "http://localhost:3100/loki/api/v1/labels" \
-H "X-Scope-OrgID: tenant1"http://localhost:3000
Login: admin / admin
Click: Explore (left sidebar)
Query: {job="osquery"}
Click: Run Query
See: Your osquery events!
Admin Users admin Change password
- Default credentials - Change Grafana & MinIO passwords immediately!
- Grafana: Admin > Users > admin > Change password
- MinIO: Update in docker-compose.yaml environment
- osqueryd: ~15-20 MB memory, <1% CPU
- Disk writes: ~10-15 MB/day (SSD-optimized)
- All components healthy and optimized
- osquery results logged to
/var/log/osquery/osqueryd.results.log - Alloy collecting and forwarding to Loki
- Data available in Grafana within minutes of events
See: DEPLOYMENT_SUMMARY.txt (troubleshooting section)
See: DEPLOYMENT_COMPLETE.md (full guide)
See: FINAL_VERIFICATION.md (verification checklist)
See: COMMANDS_REFERENCE.md (all commands)
- Open Grafana at http://localhost:3000
- Run a test query:
{job="osquery"} - Change default Grafana password
- Verify osquery events are appearing
- Create monitoring dashboards
- Set up alerting rules
- Review and adjust osquery queries
- Document your environment
- Configure Loki retention policy
- Set up automated backups
- Test failover/recovery procedures
- Create monitoring runbooks
Your Host System
osqueryd (systemd)
Logs: /var/log/osquery/
Falco (container)
Alerts: to Falcosidekick
Alloy (collect) Falcosidek
Loki Gateway
(nginx :3100)
Write Read Back
:3102 :3101 :3100
MinIO Cache
S3 Comp
Grafana
:3000
| Component | Status | Details |
|---|---|---|
| osqueryd | Running | 15.7 MB, ~22min uptime |
| Alloy | Running | Config verified & fixed |
| Loki | Healthy | 3 instances (write/read/backend) |
| Grafana | Healthy | v13.0.1+security-01 |
| Falco | Running | Security monitoring active |
| Falcosidekick | Running | Forwarding alerts |
| MinIO | Healthy | S3 storage operational |
| Gateway | Healthy | API routing working |
OVERALL: FULLY OPERATIONAL
Your monitoring stack is deployed, configured, optimized, and operational.
Next action: Open http://localhost:3000 and start exploring your logs!
For questions, refer to the documentation files listed above or check DEPLOYMENT_COMPLETE.md for the comprehensive troubleshooting guide.
Happy monitoring!