Filebeat Error: 'dataset ... has no template' — Cause, Fix, and Troubleshooting Guide
Fix Filebeat 'dataset ... has no template': load the correct index template or data stream so events for the dataset index instead of being rejected.
- #filebeat
- #logging
- #troubleshooting
- #errors
Stuck on this Filebeat error? Get the free incident triage checklist
A one-page PDF — the exact steps to isolate, fix, and verify a production error like this one. No spam, unsubscribe anytime.
What this error means
When Filebeat writes to a target that has no matching index template — often a custom index name, a module dataset whose template was never loaded, or a data stream that does not exist — Elasticsearch cannot apply the expected mappings and the write is rejected:
Failed to publish events caused by: dataset [nginx.error] has no template; the index template for the data stream may not have been installed. Run 'filebeat setup' or reload the template.
Filebeat (and Elastic Agent style integrations) resolve events to a type-dataset-namespace data stream. If the backing index template for that dataset was never installed, Elasticsearch has no mappings/settings to create the stream and refuses the bulk items. Nothing indexes for that dataset until the template is present.
How the agent reports it
has no templatein the publish error, naming a specific dataset likenginx.error.- Only some datasets fail — the ones whose module/integration template was not loaded.
filebeat setupwas skipped, or run against a different cluster than the output points at.GET _index_template/<name>returns 404 for the expected template.
Checking the agent configuration
Check whether the template for the dataset exists:
curl -sk 'https://es01:9200/_index_template?pretty' -u elastic:$ES_PASS | \
grep -i 'filebeat\|nginx'
curl -sk 'https://es01:9200/_index_template/filebeat?pretty' -u elastic:$ES_PASS
Confirm which output cluster Filebeat targets and which modules are enabled:
grep -A5 'output.elasticsearch' /etc/filebeat/filebeat.yml
filebeat modules list
Agent configuration causes
filebeat setupnever ran against the target cluster, so templates were not installed.- Module template missing — a module was enabled after setup, so its dataset template is absent.
setup.template.enabled: falsewith no template loaded out of band.- Wrong cluster — setup ran against a dev cluster but the output ships to prod.
- Custom
index:name that no template pattern matches.
Step-by-step resolution
Run setup against the cluster the output points at to install templates and pipelines:
filebeat setup --index-management -e \
-E 'output.elasticsearch.hosts=["https://es01:9200"]' \
-E 'output.elasticsearch.username=elastic' \
-E 'output.elasticsearch.password=${ES_PASS}'
If a module was enabled after setup, re-run setup so its dataset template loads:
filebeat modules enable nginx
filebeat setup --index-management
systemctl restart filebeat
For a custom index:, make sure a template pattern matches it, or point back at the managed data stream:
output.elasticsearch:
hosts: ["https://es01:9200"]
# index: "custom-%{[agent.version]}" # only if a matching template exists
setup.template.name: "filebeat"
setup.template.pattern: "filebeat-*"
Safer agent defaults
filebeat setupmust run against the same cluster the output writes to.- Enabling a module later requires re-running setup for its template.
- If you disable
setup.template.enabled, you own installing the template yourself. - Custom index names need a custom template pattern, or writes will hit this error.
Related agent errors
- Filebeat Error Guide: ‘could not load index template’
- Filebeat Error Guide: ‘ILM policy not found’
- Filebeat Error: ‘Filebeat is unable to load the ingest pipelines’
Fixed it? Get 500 Filebeat & DevOps AI prompts — free
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.
Did this fix your issue?
Trending errors this week
The error guides other engineers are actually reading right now.
- 1mount: wrong fs type, bad option, bad superblock
- 2Docker 'failed to set up container networking': Fix the Bridge and IP Pool
- 3Docker 'failed to create shim task': How to Fix the containerd Runtime Error
- 4modprobe: FATAL: Module not found
- 5mount: wrong fs type, bad option, bad superblock
- 6Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Get 500 Battle-Tested DevOps AI Prompts — Free
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.