Logstash Error: 'Multiline codec with beats input is not supported' — Cause, Fix, and Troubleshooting Guide
Fix Logstash 'Multiline codec with beats input is not supported': remove the beats codec and do multiline in Filebeat instead.
- #logstash
- #logging
- #troubleshooting
- #errors
Stuck on this Logstash 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
The beats input receives events that Filebeat has already framed and batched over the Lumberjack protocol. Because those events arrive as discrete, pre-assembled messages, you cannot attach a multiline codec to the beats input to re-stitch them — the two models are incompatible. Logstash 6+ rejects this at startup with a fatal configuration error and refuses to run:
[FATAL][logstash.runner ] An unexpected error occurred! {:error=>#<LogStash::ConfigurationError: Multiline codec with beats input is not supported. Please use the multiline codec in Filebeat.>, ...}
This is a hard stop, not a warning. The whole process exits, so no pipelines start. The message is also prescriptive: multiline reassembly must happen where the lines are still a stream — either in Filebeat (before events are shipped), or with a multiline codec on a file input if Logstash is tailing files directly. It cannot happen on the beats input.
How the agent reports it
- Logstash exits immediately at startup;
logstash-plain.logends with[FATAL][logstash.runner]. - The error text is
LogStash::ConfigurationError: Multiline codec with beats input is not supported. Please use the multiline codec in Filebeat. systemctl status logstashshows the service failed/exited rather than running.- The offending pipeline has a
beats {}block with acodec => multiline { ... }. - Stack traces and multi-line app logs were previously arriving as one event (via a
fileinput) and broke after switching to Filebeat +beats.
Checking the agent configuration
Validate the config with -t; this fatal error is caught during config parsing, so --config.test_and_exit reproduces it without starting the service:
sudo -u logstash /usr/share/logstash/bin/logstash \
-f /etc/logstash/conf.d/ \
--config.test_and_exit --path.settings /etc/logstash
# ConfigurationError: Multiline codec with beats input is not supported.
Find the offending block. Grep the pipeline configs for a multiline codec attached anywhere near a beats input:
grep -rn -e 'beats' -e 'multiline' /etc/logstash/conf.d/
The broken configuration looks like this — a multiline codec on the beats input, which Logstash rejects:
input {
beats {
port => 5044
codec => multiline { # <- illegal on a beats input
pattern => "^\s"
what => "previous"
}
}
}
Agent configuration causes
- A
multilinecodec on thebeatsinput — the direct cause; copied from afile-input config where it was valid. - Migrating from
filetobeats— a workingfileinput usingcodec => multilinewas replaced with abeatsinput but the codec was carried over. - Assuming Logstash should stitch stack traces — the reassembly was placed in Logstash instead of Filebeat, where the raw lines actually originate.
- Config templated across input types — a shared template applied a multiline codec uniformly to every input, including
beats.
Step-by-step resolution
Remove the codec from the beats block. The beats input should receive already-framed events with no multiline codec:
input {
beats {
port => 5044
client_inactivity_timeout => 60
}
}
Move the multiline logic into Filebeat, where the log lines are still an unframed stream. Reassemble stack traces there so each event Filebeat ships is already one complete record:
# filebeat.yml — join continuation lines into the preceding event
filebeat.inputs:
- type: filestream
id: app-logs
paths:
- /var/log/app/*.log
parsers:
- multiline:
type: pattern
pattern: '^[[:space:]]' # lines starting with whitespace are continuations
negate: false
match: after
output.logstash:
hosts: ["logstash.internal:5044"]
If Logstash tails files directly (no Filebeat in the path), the multiline codec is valid — but on a file input, not beats:
input {
file {
path => "/var/log/app/*.log"
codec => multiline {
pattern => "^\s"
what => "previous"
}
}
}
Safer agent defaults
- Do the multiline join in exactly one place. If Filebeat stitches events and Logstash tries to as well, you either double-join or hit this fatal error — pick the layer closest to the raw lines.
negate/matchsemantics differ from the codec. Filebeat usespattern/negate/match; the Logstash codec usespattern/what. Translate carefully so continuation lines attach to the right event.- This is a startup-fatal error. Nothing ingests until it is fixed; treat it as an outage, not a warning to clean up later.
- Watch for over-greedy patterns. A multiline pattern that matches too much will merge unrelated log entries into giant events — test against real logs.
client_inactivity_timeoutis unrelated but useful. While editing thebeatsblock, set it so idle Filebeat connections are reaped cleanly.
Related agent errors
- Logstash beats input ‘Connection reset by peer’
- Logstash beats input pipeline blocked
- Logstash ‘different character encoding’ warnings
Fixed it? Get 500 Logstash & 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.