{"record":{"id":"a06e5c263643cc8d","repo":"crowdsecurity/crowdsec","slug":"pri-must-be-a-number","errorCode":null,"errorMessage":"PRI must be a number","messagePattern":"PRI must be a number","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/syslog/internal/parser/rfc3164/parse.go","lineNumber":66,"sourceCode":"}\n\nfunc (r *RFC3164) parsePRI() error {\n\tpri := 0\n\n\tif r.buf[r.position] != '<' {\n\t\treturn errors.New(\"PRI must start with '<'\")\n\t}\n\n\tr.position++\n\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\tif c < '0' || c > '9' {\n\t\t\treturn errors.New(\"PRI must be a number\")\n\t\t}\n\t\tpri = pri*10 + int(c-'0')\n\t\tr.position++\n\t}\n\n\tif pri > 999 {\n\t\treturn errors.New(\"PRI must be up to 3 characters long\")\n\t}\n\n\tif r.position == r.len && r.buf[r.position-1] != '>' {\n\t\treturn errors.New(\"PRI must end with '>'\")\n\t}\n\n\tr.PRI = pri\n\treturn nil\n}\n\nfunc (r *RFC3164) parseTimestamp() error {","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/syslog/internal/parser/rfc3164/parse.go#L48-L84","documentation":"Validation in RFC3164 parsePRI: inside the <...> brackets a non-digit character was encountered before the closing '>'. The PRI field must be a decimal number (facility*8 + severity); letters or symbols make it unparseable, so the message is rejected.","triggerScenarios":"Thrown at pkg/acquisition/modules/syslog/internal/parser/rfc3164/parse.go:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the sender produces a numeric priority, e.g. <34> for facility 4 severity 2","Check for encoding corruption or injection inside the PRI field","Test the raw datagram with a reference syslog client to isolate the faulty producer"],"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"}