apache/seatunnel · error · IllegalArgumentException
input.multiline.match must be "after" or "before".
Error message
input.multiline.match must be "after" or "before".
What it means
input.multiline.match decides whether lines matching multiline.pattern are appended after or before the previous line. FileCollectConfig.validateMultilineMatch accepts only "after" or "before" (case-insensitive) and throws this IllegalArgumentException otherwise.
Source
Thrown at seatunnel-edge-agent/seatunnel-edge-agent-connector/src/main/java/org/apache/seatunnel/edge/agent/connector/config/FileCollectConfig.java:141
}
public boolean isJsonOutput() {
return "json".equalsIgnoreCase(outputType);
}
public boolean isSkipOnError() {
return !"fail".equalsIgnoreCase(onError);
}
private static void validateOnError(String value) {
if (!value.equalsIgnoreCase("skip") && !value.equalsIgnoreCase("fail")) {
throw new IllegalArgumentException("input.on-error must be \"skip\" or \"fail\".");
}
}
private static void validateMultilineMatch(String value) {
if (!value.equalsIgnoreCase("after") && !value.equalsIgnoreCase("before")) {
throw new IllegalArgumentException(
"input.multiline.match must be \"after\" or \"before\".");
}
}
private static void validateOutputType(String value) {
if (!value.equalsIgnoreCase("line") && !value.equalsIgnoreCase("json")) {
throw new IllegalArgumentException(
"input.output-format.type must be \"line\" or \"json\".");
}
}
private static Charset resolveCharset(String encodingName, String inputId) {
try {
return Charset.forName(encodingName);
} catch (IllegalCharsetNameException | UnsupportedCharsetException e) {
throw new IllegalArgumentException(
"input.encoding is not supported: "
+ encodingNameView on GitHub (pinned to cf67b549a7)
Solutions
- Set input.multiline.match to "after" (pattern lines belong to the previous event) or "before" (pattern lines start a new event)
- Verify the pattern/match pair semantics against your log format
- Check that template rendering is not producing an empty match value
Example fix
# before multiline.match = "forward" # after multiline.match = "after"
Defensive patterns
Strategy: validation
Validate before calling
String match = cfg.get(FileCollectOptions.MULTILINE_MATCH);
if (!"after".equalsIgnoreCase(match) && !"before".equalsIgnoreCase(match)) { throw new IllegalArgumentException("multiline.match must be after or before"); } Try / catch
try { FileCollectConfig.from(config); } catch (IllegalArgumentException e) { log.error("multiline.match invalid: {}", e.getMessage()); } Prevention
- Only use the documented values after/before
- Pair match direction with a tested multiline.pattern
- Lint multiline configs before deployment
When it happens
Trigger: Setting input.multiline.match to values like "next", "previous", "forward", "backward", or an empty string.
Common situations: Confusion with other multiline implementations that use 'before/previous' style vocabularies, or truncated templated configs.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Unknown format type:
- Unknown ftp connection mode: ${mode}
- input.multiline.flush-idle-timeout-ms must be > 0 when multi
- input.on-error must be "skip" or "fail".
- input.output-format.type must be "line" or "json".
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/c13ea5611ee0bc4e.
Report an issue: GitHub.