{"record":{"id":"40fa3baebc0cc431","repo":"crowdsecurity/crowdsec","slug":"msgid-is-empty","errorCode":null,"errorMessage":"msgid is empty","messagePattern":"msgid is empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/syslog/internal/parser/rfc5424/parse.go","lineNumber":238,"sourceCode":"\tif r.buf[r.position] == NIL_VALUE {\n\t\tr.MsgID = \"\"\n\t\tr.position += 2\n\t\treturn nil\n\t}\n\n\tmsgid := []byte{}\n\tfor r.position < r.len {\n\t\tc := r.buf[r.position]\n\t\tif c == ' ' {\n\t\t\tr.position++\n\t\t\tbreak\n\t\t}\n\t\tmsgid = append(msgid, c)\n\t\tr.position++\n\t}\n\n\tif len(msgid) == 0 {\n\t\treturn errors.New(\"msgid is empty\")\n\t}\n\n\tif len(msgid) > 32 {\n\t\treturn errors.New(\"msgid is too long\")\n\t}\n\n\tr.MsgID = string(msgid)\n\treturn nil\n}\n\nfunc (r *RFC5424) parseStructuredData() error {\n\tdone := false\n\tif r.buf[r.position] == NIL_VALUE {\n\t\tr.position += 2\n\t\treturn nil\n\t}\n\tif r.buf[r.position] != '[' {\n\t\treturn errors.New(\"structured data must start with '[' or be '-'\")","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/syslog/internal/parser/rfc5424/parse.go#L220-L256","documentation":"parseMsgID scans the MSGID field up to the next space; reaching end of buffer with zero characters collected (and no NILVALUE '-') means the mandatory MSGID is absent, so the message violates RFC 5424.","triggerScenarios":"Thrown at pkg/acquisition/modules/syslog/internal/parser/rfc5424/parse.go:238 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send '-' as MSGID when the sender has no message ID","Fix the sender to emit a non-empty MSGID or the NIL value"],"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-14T00:17:10.932Z"}