{"record":{"id":"bd39c19df40eed15","repo":"elastic/elasticsearch","slug":"invalid-output-format","errorCode":null,"errorMessage":"invalid output format [{}]","messagePattern":"invalid output format \\[(.+?)\\]","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/DateProcessor.java","lineNumber":210,"sourceCode":"        ) throws Exception {\n            String field = ConfigurationUtils.readStringProperty(TYPE, tag, config, \"field\");\n            String targetField = ConfigurationUtils.readStringProperty(TYPE, tag, config, \"target_field\", DEFAULT_TARGET_FIELD);\n            String timezoneString = ConfigurationUtils.readOptionalStringProperty(TYPE, tag, config, \"timezone\");\n            TemplateScript.Factory compiledTimezoneTemplate = null;\n            if (timezoneString != null) {\n                compiledTimezoneTemplate = ConfigurationUtils.compileTemplate(TYPE, tag, \"timezone\", timezoneString, scriptService);\n            }\n            String localeString = ConfigurationUtils.readOptionalStringProperty(TYPE, tag, config, \"locale\");\n            TemplateScript.Factory compiledLocaleTemplate = null;\n            if (localeString != null) {\n                compiledLocaleTemplate = ConfigurationUtils.compileTemplate(TYPE, tag, \"locale\", localeString, scriptService);\n            }\n            List<String> formats = ConfigurationUtils.readList(TYPE, tag, config, \"formats\");\n            String outputFormat = ConfigurationUtils.readStringProperty(TYPE, tag, config, \"output_format\", DEFAULT_OUTPUT_FORMAT);\n            try {\n                DateFormatter.forPattern(outputFormat);\n            } catch (Exception e) {\n                throw new IllegalArgumentException(\"invalid output format [\" + outputFormat + \"]\", e);\n            }\n\n            return new DateProcessor(\n                tag,\n                description,\n                compiledTimezoneTemplate,\n                compiledLocaleTemplate,\n                field,\n                formats,\n                targetField,\n                outputFormat\n            );\n        }\n    }\n\n    /**\n     * An ad-hoc cache class that just throws away the cached values once it's full because we don't want to affect the performance\n     * while applying eviction policies when adding new values or retrieving them.","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/DateProcessor.java#L192-L228","documentation":"Thrown by DateProcessor.Factory when DateFormatter.forPattern rejects the configured 'output_format' string. This is a pipeline-creation-time validation, not a per-document error: the factory probes the pattern before constructing the processor. The default output_format is 'yyyy-MM-dd\\'T\\'HH:mm:ss.SSSXXX'.","triggerScenarios":"Configuring a date processor with an 'output_format' that uses invalid Joda or unsupported java-time pattern letters, or unsupported literals. The error is raised when the pipeline is created/updated.","commonSituations":"Copy-pasting Joda-style patterns (e.g. 'YYYY-MM-dd HH:mm:ss ZZ') that map poorly to java-time; using unsupported letters; quoting mistakes where a literal is not properly escaped; version upgrades where the underlying DateFormatter moved from Joda to java-time semantics.","solutions":["Use java-time pattern letters (y not Y for year, except where week-based is intended; SSS for millis; X/X/X for zone offsets).","Quote literal text with single quotes (e.g. 'yyyy-MM-dd\\'T\\'HH:mm:ss.SSSXXX').","Test the pattern with java.time.format.DateTimeFormatter.ofPattern in isolation before deploying.","Omit output_format to accept the default ISO-8601 with millis and offset."],"exampleFix":"// before - invalid pattern letters\n{\"date\": {\"field\": \"ts\", \"formats\": [\"ISO8601\"], \"output_format\": \"YYYY-MM-DD\"}}\n// after - valid java-time pattern\n{\"date\": {\"field\": \"ts\", \"formats\": [\"ISO8601\"], \"output_format\": \"yyyy-MM-dd\"}}","handlingStrategy":"validation","validationCode":"// Validate the output_format in isolation in CI before deploying the pipeline:\n// java.time.format.DateTimeFormatter.ofPattern(\"yyyy-MM-dd\").parse(\"2024-01-01\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use java-time pattern letters (y, M, d, H, m, s, S, X).","Quote literals with single quotes ('T', 'Z').","Omit output_format to use the default ISO-8601 when unsure.","Run pipeline creation as a CI step to catch format errors before production."],"tags":["ingest","date-processor","date-format","config"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}