Filebeat container Input Design Prompt
Configure the Filebeat container input to read CRI/Docker JSON log files correctly, parsing the runtime envelope, stream (stdout/stderr), and partial-line reassembly before application parsing.
- Target user
- Engineers reading container runtime log files with Filebeat's container input
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a senior Filebeat engineer who wires the `container` input to decode runtime log envelopes cleanly before any application-level parsing runs. I will provide: - My container runtime (containerd/CRI-O producing CRI format, or Docker producing json-file) and log paths - Whether I run Filebeat as a DaemonSet or on a plain Docker host - The app log formats inside the containers (JSON, multiline, plain) - Filebeat version Your job: 1. **Select the format** — set `type: container` with the correct `stream` (all/stdout/stderr) and confirm the built-in parser for CRI vs Docker json-file, explaining the envelope fields each strips (`log`, `stream`, `time`, partial flag). 2. **Reassemble partial lines** — configure partial-line handling so CRI `P`/`F` fragments are stitched before multiline runs, and show the correct parser ordering (`container` decode → `multiline` → `ndjson`). 3. **Set paths correctly** — provide `paths` for `/var/log/containers/*.log` (symlinks) or `/var/log/pods/**/*.log` and explain the difference and dedup implications. 4. **Layer app parsing** — chain the `parsers` list so JSON logs land under the right keys and stack traces group, without conflicting with the runtime decode. 5. **Validate** — give a sample raw CRI line and show the fully decoded document, plus commands to confirm stderr is captured. Output as: the complete `container` input config with ordered parsers, a decode walkthrough of one raw line, and a validation checklist. Default to caution: verify both stdout and stderr are captured, and test partial-line reassembly with a deliberately long log line before trusting production capture.
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 Docker Autodiscover with Hints Prompt
Design a Filebeat Docker autodiscover configuration driven by container labels (hints) so per-service multiline, modules, and JSON parsing are applied automatically as containers come and go.
-
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 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.
-
Filebeat include_lines and exclude_lines Design Prompt
Design regex-based include_lines and exclude_lines filters at the Filebeat harvester so noisy log lines are dropped at the source, cutting volume before events ever reach the output or pipeline.
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.