{
  "id": "elasticsearch/missing-required-field-in-ingest-pipeline",
  "signature": "ElasticsearchParseException: Pipeline [my_pipeline] processor [set] requires field [user.email] but it is not defined in the document",
  "signature_zh": "ElasticsearchParseException：管道 [my_pipeline] 处理器 [set] 需要字段 [user.email]，但文档中未定义该字段",
  "regex": "Pipeline.*processor.*requires field.*but it is not defined in the document",
  "domain": "elasticsearch",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "An ingest pipeline processor references a field that does not exist in the incoming document, causing the pipeline to fail.",
  "root_cause_type": "generic",
  "root_cause_zh": "摄取管道处理器引用了一个传入文档中不存在的字段，导致管道失败。",
  "versions": [
    {
      "version": "Elasticsearch 7.10.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Elasticsearch 8.12.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Elasticsearch 8.14.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This may mask data quality issues and lead to incorrect processing if the field is truly required downstream; also the pipeline might still fail if other processors depend on the original field.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This bypasses data enrichment or transformation, potentially causing mapping errors or incorrect search results later.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Modify the pipeline to handle missing fields using conditional logic. For example, update the pipeline definition with an `if` context: `{\"set\": {\"field\": \"user.email\", \"value\": \"unknown@example.com\", \"if\": \"ctx.user?.email == null\"}}`",
      "success_rate": 0.88,
      "how": "Modify the pipeline to handle missing fields using conditional logic. For example, update the pipeline definition with an `if` context: `{\"set\": {\"field\": \"user.email\", \"value\": \"unknown@example.com\", \"if\": \"ctx.user?.email == null\"}}`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Fix the source data before indexing by ensuring the required field is present. For example, in Logstash, add a mutate filter: `filter { mutate { add_field => { \"[user][email]\" => \"${user_email}\" } } }` if the field exists in the event.",
      "success_rate": 0.9,
      "how": "Fix the source data before indexing by ensuring the required field is present. For example, in Logstash, add a mutate filter: `filter { mutate { add_field => { \"[user][email]\" => \"${user_email}\" } } }` if the field exists in the event.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Modify the pipeline to handle missing fields using conditional logic. For example, update the pipeline definition with an `if` context: `{\"set\": {\"field\": \"user.email\", \"value\": \"unknown@example.com\", \"if\": \"ctx.user?.email == null\"}}`",
    "Fix the source data before indexing by ensuring the required field is present. For example, in Logstash, add a mutate filter: `filter { mutate { add_field => { \"[user][email]\" => \"${user_email}\" } } }` if the field exists in the event."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html#conditional-execution",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-11-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}