{"record":{"id":"fe1cdf7e5e147d15","repo":"quickwit-oss/quickwit","slug":"index-id-pattern-pattern-is-invalid-patterns-fe1cdf","errorCode":null,"errorMessage":"index ID pattern `{pattern}` is invalid: patterns must not contain multiple consecutive `*`","messagePattern":"index ID pattern `(.+?)` is invalid: patterns must not contain multiple consecutive `\\*`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-config/src/lib.rs","lineNumber":183,"sourceCode":"            .expect(\"regular expression should compile\")\n    });\n\n    let regex = if allow_negative {\n        &IDENTIFIER_REGEX_WITH_GLOB_PATTERN_NEGATIVE\n    } else {\n        &IDENTIFIER_REGEX_WITH_GLOB_PATTERN\n    };\n\n    if !regex.is_match(pattern) {\n        bail!(\n            \"index ID pattern `{pattern}` is invalid: patterns must match the following regular \\\n             expression: `^[a-zA-Z\\\\*][a-zA-Z0-9-_\\\\.\\\\*]{{0,254}}$`\"\n        );\n    }\n    // Forbid multiple stars in the pattern to force the user making simpler patterns\n    // as multiple stars does not bring any value.\n    if pattern.contains(\"**\") {\n        bail!(\n            \"index ID pattern `{pattern}` is invalid: patterns must not contain multiple \\\n             consecutive `*`\"\n        );\n    }\n    // If there is no star in the pattern, we need at least 3 characters.\n    if !pattern.contains('*') && pattern.len() < 3 {\n        bail!(\n            \"index ID pattern `{pattern}` is invalid: an index ID must have at least 3 characters\"\n        );\n    }\n    Ok(())\n}\n\npub fn validate_node_id(node_id: &NodeIdRef) -> anyhow::Result<()> {\n    if !is_valid_hostname(node_id.as_str()) {\n        bail!(\n            \"node identifier `{node_id}` is invalid. node identifiers must be valid short \\\n             hostnames (see RFC 1123)\"","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-config/src/lib.rs#L165-L201","documentation":"quickwit-config validates index ID patterns used for wildcard index selection. A pattern may contain at most one `*` wildcard; consecutive stars (`**`) are rejected because multiple stars bring no matching value and only produce confusing, overly broad patterns. The check runs in `validate_index_id_pattern`, invoked during config validation and when building regex sets for pattern-based searches.","triggerScenarios":"Calling `validate_index_id_pattern(\"logs**\")` or any config validation path (`validate`, `build_regex_set`, `extract_otel_traces_index_id_patterns_from_metadata`, `es_compat_index_multi_search`) with a pattern string containing `**` anywhere.","commonSituations":"Users writing `my-index**` in index config or search requests assuming glob-style multi-star semantics; copy-pasted patterns from Elasticsearch (which allows `*` repetition); scripted pattern generation that appends `*` to a pattern already ending in `*`.","solutions":["Replace `**` with a single `*` in the pattern; a single trailing star already matches any suffix.","If you meant to match nested separators, remember Quickwit index IDs cannot contain `/`, so one `*` suffices.","Validate patterns before submitting by checking `!pattern.contains(\"**\")`."],"exampleFix":"// before\nindex_id_patterns: [\"logs-**\"]\n// after\nindex_id_patterns: [\"logs-*\"]","handlingStrategy":"validation","validationCode":"fn is_valid_index_id_pattern(pattern: &str) -> bool {\n    pattern.contains('*') && !pattern.contains(\"**\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never write `**` in index ID patterns; one `*` matches everything a multi-star glob would.","Centralize pattern construction in one helper that collapses consecutive stars.","Run config validation before deploying patterns."],"tags":["config","validation","wildcard","quickwit"],"backgroundTag":"invalid-regex-pattern","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}