Logstash
Ports: 5044 (Beats input), 5000 (TCP input) Developed by: Elastic Logstash is the processing layer of the ELK stack. It receives raw logs, applies transformations (parsing, field extraction, enrichment), and forwards structured documents to Elasticsearch.Pipeline Architecture
What Logstash Does to API Logs
When an API request is logged, Logstash:- Receives the raw log line from Filebeat
- Parses the log using grok patterns to extract:
- Client IP address
- HTTP method (GET, POST, PUT, DELETE)
- Request path and query string
- HTTP status code
- Response duration in milliseconds
- Error message (if any)
- Enriches with GeoIP lookup (city, country from IP)
- Adds metadata fields (environment, service name)
- Sends the structured document to Elasticsearch