projectdiscovery/katana · info

result does not match output

Error message

result does not match output

What it means

StandardWriter.Write returns this when the result fails w.matchOutput, the output match filter built from match/filter conditions (e.g. -m/-f matchers like status code, body regex, or field conditions). Results not matching the configured output criteria are rejected before being written.

Source

Thrown at pkg/output/output.go:197

	if result == nil {
		return errors.New("result is nil")
	}

	// Skip empty responses (e.g., from similarity filtering)
	if result.Response != nil && result.Response.Resp == nil && result.Response.Body == "" && result.Error == "" {
		return errors.New("response filtered by similarity detection")
	}

	if len(w.storeFields) > 0 {
		storeFields(result, w.storeFields)
	}

	if !w.extensionValidator.ValidatePath(result.Request.URL) {
		return errors.New("result does not match extension filter")
	}

	if !w.matchOutput(result) {
		return errors.New("result does not match output")
	}
	if w.filterOutput(result) {
		return errors.New("result is filtered out")
	}
	if len(w.filterPageType) > 0 && result.Response != nil && result.Response.KnowledgeBase != nil {
		if pageType, ok := result.Response.KnowledgeBase["PageType"].(string); ok {
			for _, ft := range w.filterPageType {
				if strings.EqualFold(pageType, ft) {
					return errors.New("result filtered by page type")
				}
			}
		}
	}
	var data []byte
	var err error

	if w.storeResponse && result.HasResponse() {
		if fileName, fileWriter, err := getResponseFile(w.storeResponseDir, result.Response.Resp.Request.URL.String()); err == nil {

View on GitHub (pinned to e3e742739c)

Solutions

  1. Review the matchOutput configuration (-m/-f flags) and relax or correct the match conditions.
  2. Inspect the actual result fields (status code, body, CDN flag) against the configured matchers to see which one fails.
  3. Log the failing result before Write to identify which matcher rejects it.
  4. Remove match filters if all results should be written.

Example fix

// before
katana -u https://example.com -m status:200,body:admin // too strict, results silently dropped
// after
katana -u https://example.com -m status:200 // match only on status
Defensive patterns

Strategy: validation

Validate before calling

func passesMatchers(r *output.Result, matchers []Matcher) bool {
    for _, m := range matchers {
        if !m.Match(r) { return false }
    }
    return true
}

Try / catch

if err := writer.Write(result); err != nil {
    if err.Error() == "result does not match output" {
        log.Debugf("result excluded by match rules: %+v", result)
        return nil
    }
    return err
}

Prevention

When it happens

Trigger: Calling Write(result) with output match filters configured (match-cdn, match-status, match-body, match-regex, etc.) and the result's fields do not satisfy all match conditions defined for the writer.

Common situations: Running katana with -m/-f matcher options and expecting all crawled URLs in output; match expressions typo'd or overly strict (e.g. matching a status code or body substring that rarely occurs); custom integrations feeding results through a writer configured for a different filter set.

Related errors


AI-assisted analysis of projectdiscovery/katana@e3e742739c (2026-09-03). Data as JSON: /api/errors/f79c2b5d9455b90c. Report an issue: GitHub.