# Bulk Import of data for different indices in presence of enrich ingest pipeline

**URL:** <https://discuss.elastic.co/t/bulk-import-of-data-for-different-indices-in-presence-of-enrich-ingest-pipeline/301689>\
**Category:** Elasticsearch\
**Created:** [April 6, 2022, 2:08am UTC](https://discuss.elastic.co/t/bulk-import-of-data-for-different-indices-in-presence-of-enrich-ingest-pipeline/301689 "2022-04-06T02:08:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Dominic\_Ramp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthew_dominic_ramp/32/103606_2.png) [@Matthew\_Dominic\_Ramp](https://discuss.elastic.co/u/Matthew_Dominic_Ramp)\
**Post date:** [April 6, 2022, 2:08am UTC](https://discuss.elastic.co/t/bulk-import-of-data-for-different-indices-in-presence-of-enrich-ingest-pipeline/301689/1 "2022-04-06T02:08:06Z")

</div>

Context:

- I have two indices: devices and events
- devices has an enrich policy associated with it and a pipeline was created to enable this data enrichment. This pipeline works fine.
- i want to bulk import JSON objects for devices and events. When i bulk import data for both indices, the pipeline does not work.
- when i bulk import data for devices only, the pipeline works.

Does anyone know why this happens and is there a work around for this?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 6, 2022, 2:22am UTC](https://discuss.elastic.co/t/bulk-import-of-data-for-different-indices-in-presence-of-enrich-ingest-pipeline/301689/2 "2022-04-06T02:22:33Z")

</div>

It'd be useful if you could share an example of the bulk request you are sending.

---

<div class="post-metadata">

**Author:** ![Matthew\_Dominic\_Ramp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthew_dominic_ramp/32/103606_2.png) [@Matthew\_Dominic\_Ramp](https://discuss.elastic.co/u/Matthew_Dominic_Ramp)\
**Post date:** [April 6, 2022, 2:44am UTC](https://discuss.elastic.co/t/bulk-import-of-data-for-different-indices-in-presence-of-enrich-ingest-pipeline/301689/3 "2022-04-06T02:44:22Z")

</div>

Sorry about that. Here is the bulk request:

```auto
POST /_bulk
{"update":{"_index":"mydevices","_id":"7f:74:47:8e:aa:2c"}}
{"doc":{"adv_addr":{"value":"7f:74:47:8e:aa:2c","type":"public"},"manufacturer":{"id":"0x0075","data":"QgQBgGZUOtZ1HllWOtZ1HlgBAAAAAAAA"},"flag":["general_discoverable","classic_not_supported"],"service_list":{"complete":false,"services":[{"uuid":"00001811-0000-1000-8000-00805F9B34FB"}]}},"doc_as_upsert":true}
{"index":{"_index":"theevents"}}
{"adv_addr":{"value":"7f:74:47:8e:aa:2c"},"timestamp":1648516430788,"rssi":-89}
{"update":{"_index":"mydevices","_id":"41:7b:81:3c:29:4e"}}
{"doc":{"adv_addr":{"value":"41:7b:81:3c:29:4e","type":"random"},"flag":["general_discoverable","dual_mode_controller","dual_mode_host"],"manufacturer":{"id":"0x004c","data":"EAc4H4LYuF5o"}},"doc_as_upsert":true}
{"index":{"_index":"theevents"}}
{"adv_addr":{"value":"7f:74:47:8e:aa:2c"},"timestamp":1648516430846,"rssi":-86}
{"update":{"_index":"mydevices","_id":"41:7b:81:3c:29:4e"}}
{"doc":{"adv_addr":{"value":"41:7b:81:3c:29:4e","type":"random"}},"doc_as_upsert":true}
{"update":{"_index":"mydevices","_id":"7f:74:47:8e:aa:3c"}}
{"doc":{"adv_addr":{"value":"7f:74:47:8e:aa:3c","type":"public"},"flag":["general_discoverable","classic_not_supported"],"service_list":{"complete":false,"services":[{"uuid":"0000FE59-0000-1000-8000-00805F9B34FB"}]}},"doc_as_upsert":true}
{"update":{"_index":"mydevices","_id":"59:1e:75:d6:3a:54"}}
{"doc":{"adv_addr":{"value":"59:1e:75:d6:3a:54","type":"public"},"manufacturer":{"id":"0x0075","data":"QgQBgGZUOtZ1HllWOtZ1HlgBAAAAAAAA"}},"doc_as_upsert":true}
{"index":{"_index":"theevents"}}
{"adv_addr":{"value":"7f:74:47:8e:aa:2c"},"timestamp":1648516430788,"rssi":-89}
{"index":{"_index":"theevents"}}
{"adv_addr":{"value":"7f:74:47:8e:aa:2c"},"timestamp":1648516430846,"rssi":-86}
{"index":{"_index":"theevents"}}
{"adv_addr":{"value":"7f:74:47:8e:aa:2c"},"timestamp":1648516430903,"rssi":-89}
{"index":{"_index":"theevents"}}
{"adv_addr":{"value":"59:1e:75:d6:3a:54"},"timestamp":1648516430807,"rssi":-86}

```

The pipeline enriches the manufacturer.id and services.uuid fields.

I just tested it and the pipeline only works if i bulk import the same data twice. Is there a way for me to accomplish the enrichment by bulk importing once?

---

<div class="post-metadata">

**Author:** ![Matthew\_Dominic\_Ramp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthew_dominic_ramp/32/103606_2.png) [@Matthew\_Dominic\_Ramp](https://discuss.elastic.co/u/Matthew_Dominic_Ramp)\
**Post date:** [April 6, 2022, 4:24am UTC](https://discuss.elastic.co/t/bulk-import-of-data-for-different-indices-in-presence-of-enrich-ingest-pipeline/301689/4 "2022-04-06T04:24:44Z")

</div>

It also works fine if i do a simple curl request

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 7, 2022, 3:21am UTC](https://discuss.elastic.co/t/bulk-import-of-data-for-different-indices-in-presence-of-enrich-ingest-pipeline/301689/5 "2022-04-07T03:21:12Z")

</div>

Where are you defining the pipeline, is it just a default one for the index/indices?

---

<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:** [May 5, 2022, 3:21am UTC](https://discuss.elastic.co/t/bulk-import-of-data-for-different-indices-in-presence-of-enrich-ingest-pipeline/301689/6 "2022-05-05T03:21:31Z")

</div>

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