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.
- Target user
- Streaming/platform engineers using Logstash as a producer into Kafka-based data pipelines.
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a Kafka + Logstash streaming engineer who understands producer internals: batching, acks, retries, idempotence, and how the kafka output plugin maps onto them. I will provide: - Throughput: events/s, average event size, burstiness, and number of Logstash producer nodes/workers - Kafka target: broker count, version, topic partition count, replication factor, min.insync.replicas, and whether topics are pre-created - Delivery requirements: at-least-once vs effectively-once, ordering needs (global vs per-key), acceptable duplication, and latency budget - Downstream consumers and how they key/partition data Your job: 1. **Pick delivery semantics deliberately** — map the requirement to acks (all vs 1), enable.idempotence, retries, and max.in.flight; explain the exact failure mode each setting leaves open and why acks=all + idempotence is the durable baseline. 2. **Design partitioning + ordering** — choose the message key (field-based for per-entity ordering, null/round-robin for pure throughput), reason about how workers × in-flight requests affect ordering, and size partition count for target parallelism without hot partitions. 3. **Tune the producer batch path** — batch_size, linger_ms, buffer_memory, and compression_type (lz4/zstd) trade-offs for throughput vs latency, and how Logstash pipeline.batch.size interacts with the producer's own batching. 4. **Handle backpressure and failure** — what happens when brokers are slow or unreachable (buffer fills, producer blocks, pipeline stalls), how to bound it, and pairing with a persistent queue upstream so a producer stall doesn't drop events. 5. **Secure and operate it** — SASL/TLS config, ACLs for the producer, and the producer metrics to expose (record-error-rate, retries, buffer-available-bytes, request-latency) with alert thresholds. 6. **Serialization + schema** — codec choice (json vs a schema-registry Avro path), and how to avoid poison messages that a consumer can't deserialize. Output as: (a) a semantics/durability decision with the exact config, (b) partitioning + ordering design, (c) tuned producer settings with justification, (d) backpressure + failure plan, (e) security + observability checklist. Call out every setting that trades durability for speed and require validation on a test topic before production.
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
-
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.
-
Tune the Logstash Elasticsearch Output for Throughput and Durability
Design and tune the elasticsearch output plugin — bulk sizing, data streams vs index patterns, ILM, retries, and backpressure — so ingest is fast without dropping events or overwhelming the cluster.
-
Tune Logstash Persistent Queues for Durability and Backpressure
Size and tune the persistent queue (queue.type: persisted) — page size, max_bytes, checkpoint, and acking — to survive restarts and absorb bursts without unbounded disk use or throughput collapse.
-
Design a Logstash-to-Elasticsearch Mapping & Index Template Strategy
Design the index templates, dynamic-mapping controls, and field hygiene that keep a Logstash elasticsearch output from triggering mapping conflicts, field-limit explosions, and mapper_parsing_exception rejections at scale.
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.