crowdsecurity/crowdsec · error

msgid is too long

Error message

msgid is too long

What it means

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.

Source

Thrown at pkg/acquisition/modules/syslog/internal/parser/rfc5424/parse.go:242

	}

	msgid := []byte{}
	for r.position < r.len {
		c := r.buf[r.position]
		if c == ' ' {
			r.position++
			break
		}
		msgid = append(msgid, c)
		r.position++
	}

	if len(msgid) == 0 {
		return errors.New("msgid is empty")
	}

	if len(msgid) > 32 {
		return errors.New("msgid is too long")
	}

	r.MsgID = string(msgid)
	return nil
}

func (r *RFC5424) parseStructuredData() error {
	done := false
	if r.buf[r.position] == NIL_VALUE {
		r.position += 2
		return nil
	}
	if r.buf[r.position] != '[' {
		return errors.New("structured data must start with '[' or be '-'")
	}
	prev := byte(0)
	for r.position < r.len {
		done = false

View on GitHub (pinned to 909b515798)

Solutions

  1. Shorten the MSGID emitted by the syslog client to at most 32 characters
  2. Check that MSGID is properly space-delimited from the structured data that follows
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/acquisition/modules/syslog/internal/parser/rfc5424/parse.go:242 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of crowdsecurity/crowdsec@909b515798 (2026-09-06). Data as JSON: /api/errors/ec3a6679a828f767. Report an issue: GitHub.