# Elasticsearch GeoIP Processor inside foreach processor

**URL:** <https://discuss.elastic.co/t/elasticsearch-geoip-processor-inside-foreach-processor/310681>\
**Category:** Elasticsearch\
**Tags:** ingest-pipeline\
**Created:** [July 26, 2022, 7:20pm UTC](https://discuss.elastic.co/t/elasticsearch-geoip-processor-inside-foreach-processor/310681 "2022-07-26T19:20:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![frank\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frank_2/32/108198_2.png) [@frank\_2](https://discuss.elastic.co/u/frank_2)\
**Post date:** [July 26, 2022, 7:20pm UTC](https://discuss.elastic.co/t/elasticsearch-geoip-processor-inside-foreach-processor/310681/1 "2022-07-26T19:20:43Z")

</div>

Hi,

I'm running an 8.3.2 cluster, and I have an array containing some objects over which I'd like to iterate and enrich with the GeoIP processor, but am having limited success.

I have a foreach processor set up with a geoip processor inside it. The GeoIP processor receives the \_ingest.\_value correctly, but I seemingly cannot add the looked-up information to the current object.

If I set the target\_field to simply "geo", the information appears but in the root of the JSON structure, whereas I need it added on a per-iterated-object basis instead.

Is there something that I'm overlooking? Here's a snippet of the document I'm working with:

```auto
        "answers": [
          {
            "recordTypeId": 1,
            "domainName": "blah.com",
            "rData": "123.123.123.1",
            "class": 1,
            "ttl": 60
          }
        ],

```

and the processor:

```auto
[
  {
    "foreach": {
      "field": "path.to.answers",
      "processor": {
        "geoip": {
          "field": "_ingest._value.rData",
          "target_field": "_ingest_value.geo",
          "database_file": "GeoLite2-ASN.mmdb",
          "properties": [
            "asn",
            "network"
          ],
          "first_only": false,
          "ignore_missing": false
        }
      }
    }
  }
]

```

Thanks in advance!

---

<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:** [August 23, 2022, 7:20pm UTC](https://discuss.elastic.co/t/elasticsearch-geoip-processor-inside-foreach-processor/310681/2 "2022-08-23T19:20:54Z")

</div>

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