{"record":{"id":"3fee1faa1ff358fd","repo":"projectdiscovery/katana","slug":"result-is-filtered-out","errorCode":null,"errorMessage":"result is filtered out","messagePattern":"result is filtered out","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"info","filePath":"pkg/output/output.go","lineNumber":200,"sourceCode":"\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 {\n\t\t\tif absPath, err := filepath.Abs(fileName); err == nil {\n\t\t\t\tfileName = absPath\n\t\t\t}","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/projectdiscovery/katana/blob/e3e742739c3746f085943ce918fb4e2b8daf6fe6/pkg/output/output.go#L182-L218","documentation":"StandardWriter.Write returns this when w.filterOutput(result) returns true, meaning the result matched one of the configured output filter (exclude) conditions. This is an intentional exclusion: the result was valid but explicitly filtered out by user-supplied filter rules.","triggerScenarios":"Calling Write(result) when filter conditions are configured (filter-status, filter-body, filter-regex, filter-cdn, etc.) and the result matches any of them, causing filterOutput to return true.","commonSituations":"Using katana's -fs/-fc/-f filtering options to exclude 404s, CDN assets, or soft-404 bodies and then wondering why certain URLs never appear in output; filters matching more broadly than expected (e.g. a body regex that matches nearly every page).","solutions":["Review the filter configuration (-fs/-fc/-f flags) and tighten or remove over-broad filters.","Log which result gets filtered and test each filter condition against it to find the offending rule.","Escaping/adjust regex-based body filters that unintentionally match valid pages.","Keep filter rules minimal and add them incrementally, verifying output after each change."],"exampleFix":"// before\nkatana -u https://example.com -f body:\"not found\" // regex matches far too many pages\n// after\nkatana -u https://example.com -fs 404,500 // filter only on status codes\n","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := writer.Write(result); err != nil {\n    if err.Error() == \"result is filtered out\" {\n        return nil // intentionally excluded by filter rules\n    }\n    return err\n}","preventionTips":["Keep filter rules (-fs/-fc/-f) minimal and specific","Regex body filters should be anchored to avoid over-matching","Verify filter behavior with a small known URL set first"],"tags":["output","filtering","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"}