Ever spent hours trying to set up proper Windows Event Log monitoring? I did. So I built a solution that deploys a complete ELK + Grafana stack in under 5 minutes. Here's how.
๐ฏ TL;DR
`git clone https://github.com/SecByShresth/Windows-ELK-Monitoring-Stack.git
cd Windows-ELK-Monitoring-Stack
.\oneclick-setup.ps1 # Run as Administrator
.\winlogbeat\install-winlogbeat.ps1 # Install log collector`
Result: Full Windows Event Log monitoring with Elasticsearch, Kibana, Logstash, and Grafana running locally.
๐ค The Problem
Windows Event Log monitoring shouldn't be this hard:
- โ ELK stack setup takes hours
- โ SSL certificate generation is complex
- โ Winlogbeat configuration is confusing
- โ No pre-built Windows dashboards
- โ Multiple moving parts to coordinate
What we want:
run-script.ps1 โ monitoring stack ready โ
๐ ๏ธ The Solution Architecture
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Winlogbeat โโโโโถโ Logstash โโโโโถโ Elasticsearch โ
โ (Event Collector)โ โ (Port 5044) โ โ (Port 9200) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Grafana โ โ Kibana โ โ HTTP Only โ
โ (Port 3000) โ โ (Port 5601) โ โ (Local Dev) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
Tech Stack:
- ๐ Elasticsearch 8.11.2 (storage & search)
- ๐ Kibana 8.11.2 (log exploration)
- ๐ Logstash 8.11.2 (log processing)
- ๐ Grafana Latest (dashboards)
- ๐ฅ Winlogbeat 8.15.1 (log collection)
- ๐ณ Docker (containerization)
- โก PowerShell (automation)
- ๐ Quick Start Guide
## Check PowerShell version (need 5.1+)
$PSVersionTable.PSVersion
## Verify Docker Desktop is running
docker version
1. Clone and Setup
git clone https://github.com/SecByShresth/Windows-ELK-Monitoring-Stack.git
cd Windows-ELK-Monitoring-Stack
## Set execution policy if needed
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
2. Run One-Click Setup
.\oneclick-setup.ps1
What the script does:
- โ Generates .env with random passwords
- โ Checks Docker availability
- โ Starts ELK + Grafana containers
- โ Waits for services to be ready
- โ Provides access URLs
3. Install Winlogbeat
.\winlogbeat\install-winlogbeat.ps1
This will:
- Download Winlogbeat 8.15.1
- Install to C:\Program Files\winlogbeat
- Configure for Application, System, Security logs
- Register as Windows service
- Start collecting logs immediately
- Access Your Stack
Kibana: http://localhost:5601 โ Log search & analysis
Grafana: http://localhost:3000 โ Dashboards & monitoring
Elasticsearch: http://localhost:9200 โ Raw API access
๐ฅ What Makes This Special
Zero-Configuration Deployment
.\oneclick-setup.ps1
Smart PowerShell Automation
Generates random passwords:
function RandStr($len=20) {
$bytes = New-Object 'Byte[]' $len
[System.Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($bytes)
[System.Convert]::ToBase64String($bytes) -replace '[^a-zA-Z0-9]', 'A'
}
Waits for services to be ready:
for ($i = 0; $i -lt 60; $i++) {
try {
$resp = Invoke-RestMethod -Uri 'http://localhost:9200/_cluster/health'
if ($resp.status) { break }
} catch { Start-Sleep -Seconds 5 }
}
Pre-Configured Everything
- ๐ Kibana index patterns ready
- ๐จ Grafana datasources auto-provisioned
- ๐ Logstash pipeline configured for Windows logs
- ๐ Sample dashboards included
Docker Compose Magic
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.2
environment:
- xpack.security.enabled=false
- discovery.type=single-node
ports:
- 9200:9200
kibana:
image: docker.elastic.co/kibana/kibana:8.11.2
depends_on:
- elasticsearch
ports:
- 5601:5601
๐ Project Structure
windows-elk-monitoring-stack/
โโโ oneclick-setup.ps1 # Main setup script
โโโ docker-compose.yml # Container orchestration
โโโ .env.example # Config template
โโโ grafana/
โ โโโ dashboards/ # Pre-built dashboards
โ โโโ provisioning/ # Auto-configuration
โโโ logstash/
โ โโโ pipeline/winlog.conf # Windows log processing
โโโ winlogbeat/
โ โโโ install-winlogbeat.ps1 # Collector installer
โ โโโ winlogbeat.template.yml # Log collection config
โโโ README.md # Full documentation
๐จ What You'll See
Kibana Discovery:
winlog.event_id: 4625 # Failed logons
winlog.event_data.Level: "Error" # Application errors
@timestamp >= now-1h and winlog.channel: "System" # Recent system events
Grafana Dashboards:
- Windows Events Overview
- Security Event Monitoring
- System Health Alerts
- Application Error Tracking
๐ง Advanced Usage
Custom Log Sources
winlogbeat.event_logs:
- name: Application
- name: System
- name: Security
- name: Microsoft-Windows-PowerShell/Operational
- name: Microsoft-Windows-Sysmon/Operational
Logstash Processing
input {
beats { port => 5044 }
}
filter {
if [winlog][event_id] == 4625 {
mutate { add_tag => [ "failed_login" ] }
}
}
output {
elasticsearch {
hosts => ["http://elasticsearch:9200"]
index => "winlogbeat-%{+YYYY.MM.dd}"
}
}
๐จ Important Security Notes
- โ ๏ธ This setup is for LOCAL DEVELOPMENT/TESTING. For production:
- Enable Elasticsearch X-Pack security
- Configure SSL/TLS certificates
- Change default passwords
- Implement proper authentication
- Network segmentation
๐ Troubleshooting
Docker not running:
docker version
Port conflicts:
netstat -ano | findstr ":9200"
netstat -ano | findstr ":5601"
netstat -ano | findstr ":3000"
Winlogbeat not collecting:
Get-Service winlogbeat
Get-Content "C:\Program Files\winlogbeat\logs\winlogbeat"
Restart-Service winlogbeat
๐ฏ Performance & Resource Usage
Minimum Requirements:
- ๐พ 4GB RAM (8GB recommended)
- ๐ฟ 5GB disk space
- ๐ฅ๏ธ Windows 10/11 or Server 2016+
Expected Usage:
- Elasticsearch: ~512MB RAM
- Kibana: ~200MB RAM
- Logstash: ~300MB RAM
- Grafana: ~100MB RAM
- Winlogbeat: ~50MB RAM
๐ฎ Future Enhancements
- SSL/TLS support with auto-generated certificates
- Additional pre-built security dashboards
- Sysmon integration templates
- Multi-host centralized logging
- Alert rule templates
- Performance monitoring dashboards
๐ Community & Contributions
Found this useful?
- โญ Star the repository
- ๐ Share with your network
- ๐ Report issues on GitHub
- ๐ก Contribute improvements
Connect with me:
Profile: - https://secbyshresth.github.io/Portfolio/
๐ Conclusion
Windows Event Log monitoring doesn't have to be complicated. With this one-click solution, you get:
- โ Complete ELK + Grafana stack in 5 minutes
- โ Automated Windows Event Log collection
- โ Pre-configured dashboards and index patterns
- โ Docker containerization for easy management
- โ PowerShell automation for Windows environments
Perfect for development, testing, incident response, or small-scale production monitoring.
Repository & Resources:
GitHub: https://github.com/SecByShresth/Windows-ELK-Monitoring-Stack
Quick Start:
git clone https://github.com/SecByShresth/Windows-ELK-Monitoring-Stack.git
cd Windows-ELK-Monitoring-Stack
.\oneclick-setup.ps1
Stack Access:
- Kibana: http://localhost:5601
- Grafana: http://localhost:3000
- Elasticsearch: http://localhost:9200
Top comments (0)