{"record":{"id":"04412bf14f0947de","repo":"crowdsecurity/crowdsec","slug":"message-is-empty-04412b","errorCode":null,"errorMessage":"message is empty","messagePattern":"message is empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/syslog/internal/parser/rfc5424/parse.go","lineNumber":281,"sourceCode":"\t\t\tdone = true\n\t\t\tr.position++\n\t\t\tif r.position < r.len && r.buf[r.position] == ' ' {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tprev = c\n\t\tr.position++\n\t}\n\tr.position++\n\tif !done {\n\t\treturn errors.New(\"structured data must end with ']'\")\n\t}\n\treturn nil\n}\n\nfunc (r *RFC5424) parseMessage() error {\n\tif r.position == r.len {\n\t\treturn errors.New(\"message is empty\")\n\t}\n\n\tmessage := []byte{}\n\n\tfor r.position < r.len {\n\t\tc := r.buf[r.position]\n\t\tmessage = append(message, c)\n\t\tr.position++\n\t}\n\tr.Message = string(message)\n\treturn nil\n}\n\nfunc (r *RFC5424) Parse(message []byte) error {\n\tr.len = len(message)\n\tif r.len == 0 {\n\t\treturn errors.New(\"syslog line is empty\")\n\t}","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/syslog/internal/parser/rfc5424/parse.go#L263-L299","documentation":"Returned by parseMessage when the parser position already equals the message length — the syslog line ends right after the structured-data element (or a preceding field consumed the whole buffer), leaving no MSG part.","triggerScenarios":"Thrown at pkg/acquisition/modules/syslog/internal/parser/rfc5424/parse.go:281 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Append a BOM and the message body after the structured-data element","If the empty message is legitimate per RFC5424, note that this parser still requires at least one trailing byte — send the NIL '-' or any content"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}