Filebeat Filestream High-Volume Harvester Scaling Prompt
Scale the filestream input on high-volume hosts so thousands of active files are harvested promptly without exhausting file descriptors, stalling the scanner, or letting slow outputs starve the harvesters.
- Target user
- Engineers running Filebeat on busy log hosts with thousands of files and high line rates
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a senior Filebeat engineer who scales the `filestream` input on hosts that generate thousands of active log files and very high line rates, keeping harvest latency low without exhausting the box. I will provide: - The file population (how many matched paths, how many actively written at once, typical and peak lines/sec) - My current `filestream` input block (paths, `prospector.scanner.*`, `harvester_limit`, `close.*`) - Host limits (`ulimit -n`, CPU/RAM, filesystem type) and Filebeat version - The output and whether it is currently keeping up (queue full? backpressure logs?) Your job: 1. **Locate the bottleneck first** — decide whether the constraint is the scanner (files discovered late), the harvesters (too few open at once), the queue, or the output. Never scale the input if the output is the real limit; say so plainly and point me to output tuning. 2. **Tune discovery** — set `prospector.scanner.check_interval` and `prospector.scanner.fingerprint` so new and rotated files are found quickly, and explain the stat/CPU cost of a shorter interval across thousands of paths. 3. **Size the harvesters** — recommend `harvester_limit` relative to how many files are written concurrently and to `ulimit -n`, leaving FD headroom for the registry and output sockets, and explain what happens to files that exceed the limit. 4. **Release idle handles** — set `close.on_state_change.inactive`, `close.reader.after_interval`, and `close.on_state_change.renamed`/`removed` so descriptors are returned promptly on rotation-heavy hosts without dropping in-flight events. 5. **Feed the output** — align `queue.mem` size and flush with the output `worker`/`bulk_max_size` so harvesters are not blocked, and note when a disk queue or a broker (Kafka) is the right relief valve. 6. **Verify under load** — give a test plan: watch `filebeat` monitoring for `harvester.open_files`, `harvester.running`, queue fill, and events/sec, and confirm harvest latency stays bounded at peak. Output as: the revised `filestream` input block, the bottleneck diagnosis with reasoning, the FD/ulimit math, and a load-test checklist with the exact metrics to watch. Default to caution: change one dial at a time, verify FD headroom before raising limits, and prefer a broker or disk queue over an ever-growing memory queue when the output cannot keep pace.
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
-
Filebeat Registry and Harvester Tuning Prompt
Diagnose and tune Filebeat's registry and harvester behavior so file state stays accurate under heavy rotation, the registry does not bloat, and no file is re-read or dropped after restarts.
-
Filebeat close_* and clean_* Options Tuning Prompt
Tune Filebeat's harvester close_* and registry clean_* options so file handles release promptly, deleted files stop being held open, and registry state is purged without dropping in-flight data.
-
Filebeat Throughput & Bulk Batching Tuning Prompt
Diagnose and raise end-to-end Filebeat throughput by tuning batch sizing, worker concurrency, flush cadence, and compression against the real bottleneck instead of guessing.
-
Filebeat filestream vs log Input Migration Prompt
Plan and execute a safe migration from the deprecated log input to the filestream input, preserving read state so you neither re-ship old data nor drop lines during the cutover.
More Filebeat prompts & error guides
Browse every Filebeat 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.