{"record":{"id":"62d5666edc1216b4","repo":"vectordotdev/vector","slug":"global-log-schema-host-key-to-be-valid-path","errorCode":null,"errorMessage":"global log_schema.host_key to be valid path","messagePattern":"global log_schema\\.host_key to be valid path","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/sources/datadog_agent/mod.rs","lineNumber":476,"sourceCode":"impl DatadogAgentSource {\n    pub(crate) fn new(\n        store_api_key: bool,\n        decoder: Decoder,\n        protocol: &'static str,\n        logs_schema_definition: Option<schema::Definition>,\n        log_namespace: LogNamespace,\n        parse_ddtags: bool,\n        split_metric_namespace: bool,\n    ) -> Self {\n        Self {\n            api_key_extractor: ApiKeyExtractor {\n                store_api_key,\n                matcher: Regex::new(r\"^/v1/input/(?P<api_key>[[:alnum:]]{32})/??\")\n                    .expect(\"static regex always compiles\"),\n            },\n            log_schema_host_key: log_schema()\n                .host_key_target_path()\n                .expect(\"global log_schema.host_key to be valid path\")\n                .clone(),\n            log_schema_source_type_key: log_schema()\n                .source_type_key_target_path()\n                .expect(\"global log_schema.source_type_key to be valid path\")\n                .clone(),\n            decoder,\n            protocol,\n            logs_schema_definition: logs_schema_definition.map(Arc::new),\n            log_namespace,\n            events_received: register!(EventsReceived),\n            parse_ddtags,\n            split_metric_namespace,\n        }\n    }\n\n    fn build_warp_filters(\n        &self,\n        handler: RequestHandler,","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/vectordotdev/vector/blob/0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460/src/sources/datadog_agent/mod.rs#L458-L494","documentation":"During Datadog Agent source construction, the global log schema's host key is converted to a target path; .expect(\"global log_schema.host_key to be valid path\") panics if the configured host key string is not a valid event path. This indicates a broken global `log_schema.host_key` configuration value.","triggerScenarios":"Starting Vector with a datadog_agent source while the global log_schema.host_key setting (or default) cannot be parsed into a valid Value path, e.g. an empty string or characters invalid for path parsing.","commonSituations":"Users overriding log_schema.host_key in config with an empty or malformed key like \"\" or \"a..b\"; environment-driven schema overrides producing invalid values; broken default after a version change.","solutions":["Set log_schema.host_key to a valid field path such as \"host\".","Remove the custom log_schema.host_key override to restore the valid default.","Check for stray whitespace or empty values coming from env-var-based config templating."],"exampleFix":"# before (invalid)\nlog_schema:\n  host_key: \"\"\n# after\nlog_schema:\n  host_key: \"host\"","handlingStrategy":"validation","validationCode":"// validate before starting vector:\n// vector validate --no-environment config.yaml\nif !host_key.is_empty() && lookup_path(host_key).is_none() {\n    eprintln!(\"invalid log_schema.host_key: {}\", host_key);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `vector validate` on config before deployment.","Keep log_schema overrides to simple dotted paths like \"host\".","Check env-based templating for empty substitutions."],"tags":["rust","panic","config","log-schema"],"backgroundTag":"invalid-config-value","analyzedSha":"0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}