Filebeat Nginx Module Setup Prompt
Configure the Filebeat nginx module to harvest access and error logs with correct paths, custom log-format handling, and the ingest pipeline so requests, status codes, and geo fields parse cleanly.
- Target user
- Engineers onboarding Nginx logs into Elastic via the Filebeat nginx module
- Difficulty
- Beginner
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a senior Filebeat engineer who onboards web-tier logs using the built-in modules and knows exactly where the nginx module's assumptions break. I will provide: - My Nginx `access_log` and `error_log` paths (and whether they are non-standard) - My `log_format` directive if it differs from the default `combined` - Filebeat version and how modules are enabled (modules.d, `filebeat.config.modules`, or Docker/K8s) - Whether logs are already JSON Your job: 1. **Enable correctly** — show whether to use `filebeat modules enable nginx` or a `filebeat.config.modules` glob, and the resulting `nginx.yml` with `access` and `error` filesets, `var.paths`, and `enabled` flags. 2. **Match the log format** — verify my `log_format` against what the module's ingest pipeline expects; if it is custom, tell me precisely which fields will fail to parse and whether to normalize the Nginx format or clone/patch the pipeline. 3. **Wire the pipeline** — explain how the module's ingest pipeline (grok + geoip + user_agent) is loaded, how to reload it after edits, and how to confirm documents land with `url.original`, `http.response.status_code`, and `source.geo.*`. 4. **Handle harvesting details** — set `var.paths` for rotated/dated files and confirm the harvester picks up gzipped-vs-plain rotations correctly. 5. **Validate** — give the commands to test end-to-end (`filebeat test config`, a sample line through the pipeline simulate API) and what a healthy parsed document looks like. Output as: the `nginx.yml` module config, any pipeline adjustment notes for custom formats, and a validation checklist. Default to caution: confirm the module's ingest pipeline and index template land in a test cluster before pointing production hosts at it, and diff a parsed sample document against the expected ECS fields.
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 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.
-
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.