{"record":{"id":"c91c3e14a5dc2650","repo":"crowdsecurity/crowdsec","slug":"group-name-is-mandatory-for-cloudwatchsource","errorCode":null,"errorMessage":"group_name is mandatory for CloudwatchSource","messagePattern":"group_name is mandatory for CloudwatchSource","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/cloudwatch/config.go","lineNumber":104,"sourceCode":"\t}\n\n\tif c.AwsApiCallTimeout == nil {\n\t\tc.AwsApiCallTimeout = &def_AwsApiCallTimeout\n\t}\n\n\tif c.AwsConfigDir == nil {\n\t\tc.AwsConfigDir = &def_AwsConfigDir\n\t}\n}\n\n\ntype ValidationWarning string\n\nfunc (c *Configuration) Validate() ([]ValidationWarning, error) {\n\tvar warns []ValidationWarning\n\n\tif c.GroupName == \"\" {\n\t\treturn warns, errors.New(\"group_name is mandatory for CloudwatchSource\")\n\t}\n\n\tif *c.MaxStreamAge > *c.StreamReadTimeout {\n\t\twarns = append(warns, \"max_stream_age > stream_read_timeout, stream might keep being opened/closed\")\n\t}\n\n\treturn warns, nil\n}\n\n\nfunc (s *Source) UnmarshalConfig(yamlConfig []byte) error {\n\tcfg, warns, err := ConfigurationFromYAML(yamlConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, w := range warns {\n\t\ts.logger.Warn(w)","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/cloudwatch/config.go#L86-L122","documentation":"CloudwatchSource.Validate() enforces that a group_name is present in the cloudwatch datasource configuration — it identifies the CloudWatch Logs log group to read. An empty group_name makes the datasource impossible to configure, so validation fails.","triggerScenarios":"ConfigurationFromYAML parses a cloudwatch datasource whose group_name is empty/absent, then calls Validate() which returns this error.","commonSituations":"Missing group_name key in acquisition.yaml; empty value (group_name: \"\"); YAML indentation nesting group_name outside the datasource stanza.","solutions":["Set group_name to your CloudWatch Logs log group name in the cloudwatch datasource config","Fix YAML nesting/typo so group_name sits under the datasource entry","Check the exact group name in the AWS console (case-sensitive)"],"exampleFix":"// before\nsource: cloudwatch\naws_region: us-east-1\n// after\nsource: cloudwatch\naws_region: us-east-1\ngroup_name: /my/log/group\nstream_name: my-stream","handlingStrategy":"validation","validationCode":"if cwCfg.GroupName == \"\" { return errors.New(\"cloudwatch datasource requires group_name\") }","typeGuard":null,"tryCatchPattern":"warns, err := cfg.Validate()\nif err != nil {\n    if strings.Contains(err.Error(), \"group_name is mandatory\") { /* set group_name */ }\n    return err\n}","preventionTips":["Include group_name in every cloudwatch datasource stanza","Copy the exact log group name from the AWS console","Run config validation before restarting crowdsec"],"tags":["cloudwatch","aws","configuration","validation"],"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"}