{"record":{"id":"84239863318cebed","repo":"crowdsecurity/crowdsec","slug":"victorialogs-url-is-mandatory","errorCode":null,"errorMessage":"VictoriaLogs url is mandatory","messagePattern":"VictoriaLogs url is mandatory","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/victorialogs/config.go","lineNumber":49,"sourceCode":"\tPrefix                            string              `yaml:\"prefix\"` // VictoriaLogs prefix\n\tQuery                             string              `yaml:\"query\"`  // LogsQL query\n\tLimit                             int                 `yaml:\"limit\"`  // Limit of logs to read\n\tSince                             time.Duration       `yaml:\"since\"`\n\tHeaders                           map[string]string   `yaml:\"headers\"`        // HTTP headers for talking to VictoriaLogs\n\tWaitForReady                      time.Duration       `yaml:\"wait_for_ready\"` // Retry interval, default is 10 seconds\n\tAuth                              AuthConfiguration `yaml:\"auth\"`\n\tMaxFailureDuration                time.Duration       `yaml:\"max_failure_duration\"` // Max duration of failure before stopping the source\n\tconfiguration.DataSourceCommonCfg `yaml:\",inline\"`\n}\n\nfunc (s *Source) UnmarshalConfig(yamlConfig []byte) error {\n\terr := yaml.UnmarshalWithOptions(yamlConfig, &s.Config, yaml.Strict())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot parse VictoriaLogs acquisition configuration: %s\", yaml.FormatError(err, false, false))\n\t}\n\n\tif s.Config.URL == \"\" {\n\t\treturn errors.New(\"VictoriaLogs url is mandatory\")\n\t}\n\n\tif s.Config.Query == \"\" {\n\t\treturn errors.New(\"VictoriaLogs query is mandatory\")\n\t}\n\n\tif s.Config.WaitForReady == 0 {\n\t\ts.Config.WaitForReady = 10 * time.Second\n\t}\n\n\tif s.Config.Mode == \"\" {\n\t\ts.Config.Mode = configuration.TAIL_MODE\n\t}\n\n\tif s.Config.Prefix == \"\" {\n\t\ts.Config.Prefix = \"/\"\n\t}\n","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/victorialogs/config.go#L31-L67","documentation":"The VictoriaLogs acquisition config requires a 'url' field pointing at the VictoriaLogs instance's query endpoint. UnmarshalConfig parses the YAML with strict mode and then validates required fields; an empty url aborts datasource configuration.","triggerScenarios":"A VictoriaLogs acquisition YAML (data_source: victorialogs) parsed without a 'url:' key, or url left as empty string.","commonSituations":"Copy-pasting a config template without filling in the url; typo'd key like 'uri:' rejected by strict unmarshalling or silently empty; config generated by tooling omitting optional-looking fields.","solutions":["Add the url key to the acquisition config, e.g. url: http://victorialogs:9428","Verify the key spelling is exactly 'url'","Validate the YAML loads against the source's expected schema"],"exampleFix":"// before\nsource: victorialogs\nquery: '*'\n// after\nsource: victorialogs\nurl: http://victorialogs:9428\nquery: '*'","handlingStrategy":"validation","validationCode":"// check config before applying\nif cfg[\"url\"] == \"\" { return errors.New(\"victorialogs url is required\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use cscli to validate acquis configs before restart","Keep a complete config template with url filled in","Run crowdsec in check/lint mode after config changes"],"tags":["yaml","configuration","victorialogs"],"backgroundTag":"missing-required-config-field","analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}