{"record":{"id":"ec3a6679a828f767","repo":"crowdsecurity/crowdsec","slug":"msgid-is-too-long","errorCode":null,"errorMessage":"msgid is too long","messagePattern":"msgid is too long","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/syslog/internal/parser/rfc5424/parse.go","lineNumber":242,"sourceCode":"\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 '-'\")\n\t}\n\tprev := byte(0)\n\tfor r.position < r.len {\n\t\tdone = false","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/syslog/internal/parser/rfc5424/parse.go#L224-L260","documentation":"RFC5424 parser guard: the MSGID field exceeded the 32-byte maximum length permitted by the syslog spec. The parser reads MSGID up to the next space and rejects values longer than 32 characters, indicating a malformed message.","triggerScenarios":"Thrown at pkg/acquisition/modules/syslog/internal/parser/rfc5424/parse.go:242 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Shorten the MSGID emitted by the syslog client to at most 32 characters","Check that MSGID is properly space-delimited from the structured data that follows"],"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"}