# Obtain document ID just after insert

**URL:** <https://discuss.elastic.co/t/obtain-document-id-just-after-insert/123262>\
**Category:** Logstash\
**Created:** [March 9, 2018, 12:58pm UTC](https://discuss.elastic.co/t/obtain-document-id-just-after-insert/123262 "2018-03-09T12:58:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![panchicore](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/panchicore/32/20150_2.png) [@panchicore](https://discuss.elastic.co/u/panchicore)\
**Post date:** [March 9, 2018, 12:58pm UTC](https://discuss.elastic.co/t/obtain-document-id-just-after-insert/123262/1 "2018-03-09T12:58:44Z")

</div>

The idea is to send the record to ES using the output filter, this works great, but there is posibility to obtain the document id after to continue with other enrichment pipeline triggered by, for example a kafka output? at the end, the result should be an update based in the document key, and the original document hasn't a good pattern to construct the \_id in order to make a query in the second pipeline. ([...and I want to follow this tip](https://www.elastic.co/guide/en/elasticsearch/reference/current/tune-for-indexing-speed.html#_use_auto_generated_ids) and [this](https://qbox.io/blog/maximize-guide-elasticsearch-indexing-performance-part-1)) ... should I generate a uuid with a filter? [but it resolves an uuid-4](https://www.elastic.co/guide/en/logstash/current/plugins-filters-uuid.html#_description_137) ☹

thanks for the lights.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 9, 2018, 1:18pm UTC](https://discuss.elastic.co/t/obtain-document-id-just-after-insert/123262/2 "2018-03-09T13:18:58Z")

</div>

> The idea is to send the record to ES using the output filter, this works great, but there is posibility to obtain the document id after to continue with other enrichment pipeline triggered by, for example a kafka output?

No, that's currently not possible. You'll have to generate the id in a filter.

---

<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:** [April 6, 2018, 1:19pm UTC](https://discuss.elastic.co/t/obtain-document-id-just-after-insert/123262/3 "2018-04-06T13:19:11Z")

</div>

Closed on April 6, 2018, 1:19pm UTC

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