Logstash Kafka Input Design Prompt
Design a resilient Logstash kafka input that consumes from topics with correct consumer-group semantics, partition-to-worker mapping, offset handling, and at-least-once delivery guarantees.
- Target user
- Streaming and observability engineers integrating Kafka with the Elastic Stack
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a senior data-streaming engineer who designs Logstash `kafka` inputs for high-throughput log and event pipelines.
I will provide:
- Topic(s), partition count, replication factor, and message format (JSON, Avro, plain, with/without schema registry)
- Target throughput and acceptable delivery semantics (at-least-once vs stricter)
- Broker security (PLAINTEXT, SSL, SASL_SSL, mechanism) and network topology
- Number of Logstash consumer nodes and their pipeline.yml
Your job:
1. **Input block** — produce a complete `input { kafka { ... } }`: bootstrap_servers, topics/topics_pattern, group_id, client_id, codec (json/avro), and security_protocol/sasl settings via keystore references.
2. **Parallelism** — set `consumer_threads` relative to partition count across all Logstash nodes so every partition has exactly one consumer without idle threads; explain the partition-to-thread math.
3. **Offset & delivery** — configure `auto_offset_reset`, `enable_auto_commit`, and `auto_commit_interval_ms`; explain the duplicate-vs-loss tradeoff and where commits happen relative to the pipeline queue.
4. **Rebalance safety** — tune `session_timeout_ms`, `max_poll_interval_ms`, and `max_poll_records` so slow filters/outputs don't cause the consumer to be evicted mid-batch.
5. **Metadata** — capture `[@metadata][kafka]` fields (topic, partition, offset, timestamp) for debugging and idempotency downstream, then drop them before output.
6. **Decode failures** — handle malformed/undecodable messages so one poison record doesn't stall a partition.
Output as: (a) annotated input config, (b) partition/thread sizing table, (c) offset & rebalance rationale, (d) failure-handling and validation steps.
Confirm partition count and node count before recommending consumer_threads.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Design a Reliable Logstash Kafka Output
Design the kafka output plugin for durability and ordering — acks, idempotence, partitioning, compression, and delivery semantics — so Logstash publishes to Kafka without silent data loss or duplication.
-
Logstash Beats Input Design Prompt
Design and harden a Logstash beats input that ingests from Filebeat/Metricbeat fleets at scale, with TLS, backpressure tuning, and clean field handling before filtering.
-
Logstash HTTP Input Design Prompt
Design a Logstash http input that safely receives webhooks and application events over HTTP(S), with authentication, TLS, request validation, and codec handling before events enter the pipeline.
-
Logstash JDBC Input Incremental Ingest Prompt
Design a Logstash jdbc input that incrementally pulls rows from a relational database using a tracking column, safe scheduling, and pagination — without re-reading the whole table or missing updates.
More Logstash prompts & error guides
Browse every Logstash prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.