๐ฅ From Zero to ELK Stack on EC2 โ Fully Automated
๐ The Problem
Centralized logging is a must โ especially when youโve got multiple instances running, logs scattered everywhere, and no idea where that 500 error came from.
But standing up ELK (Elasticsearch, Logstash, Kibana) can be... a pain.
I wanted a single EC2 instance running the full ELK stack โ logs routed and searchable โ all with one command. No manual installs. No clicky walkthroughs.
๐ ๏ธ The Fix: A Bash-Based ELK Installer
I wrote a bash script that:
- โ
Sets up an EC2 instance with IAM + Security Group preconfigured
- ๐ฆ Installs Elasticsearch, Logstash, and Kibana with version compatibility handled
- ๐ Opens the right ports (9200, 5601, etc.) so it works out of the box
- ๐งช Runs a test log to validate the pipeline end-to-end
Result: A working, log-ready ELK stack you can SSH into and start using immediately.
๐ฌ GitHub Link
Full installer script and details:
๐
github.com/chinmaya-chhatre/elk-integration
๐ What Changed
- ๐ Gained full visibility into application logs in < 10 minutes
- ๐ ๏ธ Made log search and dashboarding possible without any third-party tools
- ๐งน Reduced log noise with filters and pipeline tuning
โ๏ธ Tradeoffs I Made
- Single-Instance Stack: No HA or cluster setup โ perfect for demos and small apps, not production scale
- No Persistent Storage: Defaults to ephemeral disk โ logs reset on restart unless customized
- Basic Security: Left auth open for testing โ production use would need auth+HTTPS setup
๐ง What I'd Add Next
- ๐ Add basic auth and TLS config for Kibana access
- ๐ค Push logs from multiple instances via Filebeat or FluentBit
- ๐ Package it as a reusable shell module or Terraform wrapper
๐งต Why Iโm Sharing This
Because setting up ELK shouldnโt require a YouTube tutorial + 2 hours.
Because log visibility is too important to delay.
And because this script helped me debug real issues โ fast.
๐ Bonus Links