{"record":{"id":"528d6407fe818f00","repo":"elastic/elasticsearch","slug":"invalid-dot-validation-exception-pattern","errorCode":null,"errorMessage":"invalid dot validation exception pattern: [{}]","messagePattern":"invalid dot validation exception pattern: \\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/dot-prefix-validation/src/main/java/org/elasticsearch/validation/DotPrefixValidator.java","lineNumber":108,"sourceCode":"            \"\\\\.monitoring-ent-search-8-.*\",\n            // data streams defined in files in x-pack/plugin/core/template-resources/src/main/resources/fleet-*:\n            \"\\\\.fleet-fileds-fromhost-data-.*\",\n            \"\\\\.fleet-fileds-fromhost-meta-.*\",\n            \"\\\\.fleet-fileds-tohost-data-.*\",\n            \"\\\\.fleet-fileds-tohost-meta-.*\",\n            // data stream definied in x-pack/plugin/core/template-resources/src/main/resources/kibana-reporting@template.json:\n            \"\\\\.kibana-reporting.*\",\n            // data stream defined in x-pack/plugin/core/template-resources/src/main/resources/slm-history.json:\n            \"\\\\.slm-history-7.*\",\n            // index defined in\n            // x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/connector/ConnectorTemplateRegistry.java\n            \"\\\\.search-acl-filter-.*\"\n        ),\n        (patternList) -> patternList.forEach(pattern -> {\n            try {\n                Pattern.compile(pattern);\n            } catch (PatternSyntaxException e) {\n                throw new IllegalArgumentException(\"invalid dot validation exception pattern: [\" + pattern + \"]\", e);\n            }\n        }),\n        Setting.Property.NodeScope,\n        Setting.Property.Dynamic\n    );\n\n    DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DotPrefixValidator.class);\n\n    private final ThreadContext threadContext;\n    private final SystemIndices systemIndices;\n    private final boolean isEnabled;\n    private final boolean isStateless;\n    private volatile Set<Pattern> ignoredIndexPatterns;\n\n    public DotPrefixValidator(ThreadContext threadContext, ClusterService clusterService, SystemIndices systemIndices) {\n        this.threadContext = threadContext;\n        this.systemIndices = systemIndices;\n        this.isEnabled = VALIDATE_DOT_PREFIXES.get(clusterService.getSettings());","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/dot-prefix-validation/src/main/java/org/elasticsearch/validation/DotPrefixValidator.java#L90-L126","documentation":"IllegalArgumentException thrown while validating the dynamic setting cluster.indices.validate_ignored_dot_patterns: each configured string is compiled with Pattern.compile, and an invalid regex surfaces the offending pattern and chains the PatternSyntaxException as cause. This is a bootstrap-time / settings-update-time guard, not a per-request one.","triggerScenarios":"PUT /_cluster/settings updating cluster.indices.validate_ignored_dot_patterns with an entry containing invalid regex syntax (unclosed bracket, dangling meta-char, bad escape). The Setting validator runs on apply.","commonSituations":"Operator adds a custom ignore pattern with a typo (e.g. missing closing ] or unescaped '.'); copy/paste from docs that lost escaping; expecting glob semantics and writing '*.' instead of '\\..*'.","solutions":["Fix the offending regex entry (proper escaping; Java regex, not glob)","Test each pattern with Pattern.compile locally before applying","If you need a literal dot prefix, anchor it as \"\\\\.name-.*\""],"exampleFix":"// before\nPUT _cluster/settings\n{\"persistent\":{\"cluster.indices.validate_ignored_dot_patterns\":[\".myapp-.*\"]}} // leading dot is literal but pattern is loose\n// after\nPUT _cluster/settings\n{\"persistent\":{\"cluster.indices.validate_ignored_dot_patterns\":[\"\\\\.myapp-.*\"]}}","handlingStrategy":"validation","validationCode":"// Validate each pattern before applying the setting:\nfor (String p : patterns) {\n    try { Pattern.compile(p); }\n    catch (PatternSyntaxException e) { throw new IllegalArgumentException(\"bad pattern: \" + p, e); }\n}","typeGuard":null,"tryCatchPattern":"try { clusterClient.updateSettings(persistent); }\ncatch (IllegalArgumentException e) { /* e.getCause() is PatternSyntaxException; fix and retry */ }","preventionTips":["Remember these are Java regex, not globs — escape dots as \"\\\\.\"","Unit-test new patterns with Pattern.compile before pushing to production","Apply settings changes via config-as-code pipelines with a validation stage"],"tags":["settings","regex","dot-prefix","validation","dynamic-setting"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}