# Enrich processor debug statements

**URL:** <https://discuss.elastic.co/t/enrich-processor-debug-statements/272921>\
**Category:** Elasticsearch\
**Tags:** ingest-pipeline\
**Created:** [May 13, 2021, 2:58pm UTC](https://discuss.elastic.co/t/enrich-processor-debug-statements/272921 "2021-05-13T14:58:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sulsulatoff](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@sulsulatoff](https://discuss.elastic.co/u/sulsulatoff)\
**Post date:** [May 13, 2021, 2:58pm UTC](https://discuss.elastic.co/t/enrich-processor-debug-statements/272921/1 "2021-05-13T14:58:48Z")

</div>

I am using enrich processor with ingest pipeline. The enrichment works when I simulate the pipeline but fails when ingesting a doc.  
How can I debug what is going wrong? Verified that the Pipeline is indeed been invoked as the failure condition is set.

Enrich policy definition :

```
 PUT /_enrich/policy/my-enrich_policy
   {
         "match": {
            "indices": "master-index",
            "match_field": "customer_prefix",
            "enrich_fields": ["country", "geo"]
          }
   }       

PUT /_enrich/policy/my-enrich_policy/_execute

```

Pipeline definition:

```
PUT /_ingest/pipeline/enrich_pipeline
{
  "description": "Enrich country ",
  "processors": [
    {
      "lowercase": {
        "field": "customer_prefix"
      }
    },
    {
      "enrich": {
        "policy_name": "my-enrich_policy",
        "field": "customer_prefix",
        "target_field": "enriched",
        "on_failure": [
          {
            "set": {
              "field": "enriched",
              "value": "false"
            }
          }
        ]
      }
    }
  ]
}
```

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [May 13, 2021, 3:22pm UTC](https://discuss.elastic.co/t/enrich-processor-debug-statements/272921/2 "2021-05-13T15:22:04Z")

</div>

Hi @sulsulatoff

One thing to note is `_simluate` does not actually index a document, it just transforms the data so if you have a mapping issue that can cause the document to not be actually indexed even if the pipeline / enrich works.

I have run into this before... so perhaps actually try to index a document from the Dev Tools and see what you see.

```
POST my-index/_doc?pipeline=enrich_pipeline
{
  "@timestamp": "2099-03-07T11:04:05.000Z",
  "my-keyword-field": "foo"
  "..."
}
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 10, 2021, 3:22pm UTC](https://discuss.elastic.co/t/enrich-processor-debug-statements/272921/3 "2021-06-10T15:22:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
