{"record":{"id":"f79c2b5d9455b90c","repo":"projectdiscovery/katana","slug":"result-does-not-match-output","errorCode":null,"errorMessage":"result does not match output","messagePattern":"result does not match output","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"info","filePath":"pkg/output/output.go","lineNumber":197,"sourceCode":"\tif result == nil {\n\t\treturn errors.New(\"result is nil\")\n\t}\n\n\t// Skip empty responses (e.g., from similarity filtering)\n\tif result.Response != nil && result.Response.Resp == nil && result.Response.Body == \"\" && result.Error == \"\" {\n\t\treturn errors.New(\"response filtered by similarity detection\")\n\t}\n\n\tif len(w.storeFields) > 0 {\n\t\tstoreFields(result, w.storeFields)\n\t}\n\n\tif !w.extensionValidator.ValidatePath(result.Request.URL) {\n\t\treturn errors.New(\"result does not match extension filter\")\n\t}\n\n\tif !w.matchOutput(result) {\n\t\treturn errors.New(\"result does not match output\")\n\t}\n\tif w.filterOutput(result) {\n\t\treturn errors.New(\"result is filtered out\")\n\t}\n\tif len(w.filterPageType) > 0 && result.Response != nil && result.Response.KnowledgeBase != nil {\n\t\tif pageType, ok := result.Response.KnowledgeBase[\"PageType\"].(string); ok {\n\t\t\tfor _, ft := range w.filterPageType {\n\t\t\t\tif strings.EqualFold(pageType, ft) {\n\t\t\t\t\treturn errors.New(\"result filtered by page type\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tvar data []byte\n\tvar err error\n\n\tif w.storeResponse && result.HasResponse() {\n\t\tif fileName, fileWriter, err := getResponseFile(w.storeResponseDir, result.Response.Resp.Request.URL.String()); err == nil {","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/projectdiscovery/katana/blob/e3e742739c3746f085943ce918fb4e2b8daf6fe6/pkg/output/output.go#L179-L215","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Review the matchOutput configuration (-m/-f flags) and relax or correct the match conditions.","Inspect the actual result fields (status code, body, CDN flag) against the configured matchers to see which one fails.","Log the failing result before Write to identify which matcher rejects it.","Remove match filters if all results should be written."],"exampleFix":"// before\nkatana -u https://example.com -m status:200,body:admin // too strict, results silently dropped\n// after\nkatana -u https://example.com -m status:200 // match only on status\n","handlingStrategy":"validation","validationCode":"func passesMatchers(r *output.Result, matchers []Matcher) bool {\n    for _, m := range matchers {\n        if !m.Match(r) { return false }\n    }\n    return true\n}","typeGuard":null,"tryCatchPattern":"if err := writer.Write(result); err != nil {\n    if err.Error() == \"result does not match output\" {\n        log.Debugf(\"result excluded by match rules: %+v\", result)\n        return nil\n    }\n    return err\n}","preventionTips":["Test match expressions against sample results before full runs","Start with no matchers and add them incrementally","Log rejected results to verify which matcher fails"],"tags":["output","filtering","matchers","go"],"backgroundTag":"result-filtered-by-output-rules","analyzedSha":"e3e742739c3746f085943ce918fb4e2b8daf6fe6","analyzedAt":"2026-09-03T14:55:13.248Z","contentChangedAt":"2026-09-03T14:55:13.248Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}