probelabs/goreplay · error

need both header and value, colon-delimited (ex. user_id:50%

Error message

need both header and value, colon-delimited (ex. user_id:50%)

What it means

Flag-value validation error raised by HTTPHashFilters.Set (used by --http-allow-header-hash/--http-allow-param-hash) when the argument lacks a colon separating the header/param name from its hash percentage, so no hashFilter can be constructed.

Source

Thrown at http_modifier_settings.go:98

// Handling of --http-allow-header-hash and --http-allow-param-hash options
type hashFilter struct {
	name    []byte
	percent uint32
}

// HTTPHashFilters represents a slice of header hash filters
type HTTPHashFilters []hashFilter

func (h *HTTPHashFilters) String() string {
	return fmt.Sprint(*h)
}

// Set method to implement flags.Value
func (h *HTTPHashFilters) Set(value string) error {
	valArr := strings.SplitN(value, ":", 2)
	if len(valArr) < 2 {
		return errors.New("need both header and value, colon-delimited (ex. user_id:50%)")
	}

	f := hashFilter{name: []byte(valArr[0])}

	val := strings.TrimSpace(valArr[1])

	if strings.Contains(val, "%") {
		p, _ := strconv.ParseInt(val[:len(val)-1], 0, 0)
		f.percent = uint32(p)
	} else if strings.Contains(val, "/") {
		// DEPRECATED format
		var num, den uint64

		fracArr := strings.Split(val, "/")
		num, _ = strconv.ParseUint(fracArr[0], 10, 64)
		den, _ = strconv.ParseUint(fracArr[1], 10, 64)

		f.percent = uint32((float64(num) / float64(den)) * 100)

View on GitHub (pinned to 251e45abd2)

Solutions

  1. Supply both parts separated by a colon, e.g. --http-allow-header-hash 'user_id:50%'
  2. If you meant a percentage-only value, remember the header name must come first
  3. Verify the value reaches Set intact (shell quoting, config templating)
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at http_modifier_settings.go:98 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of probelabs/goreplay@251e45abd2 (2026-09-02). Data as JSON: /api/errors/a3d350b99d5ae9dc. Report an issue: GitHub.