# Logstash elasticsearch output plugin upsert without document\_id

**URL:** <https://discuss.elastic.co/t/logstash-elasticsearch-output-plugin-upsert-without-document-id/151151>\
**Category:** Logstash\
**Created:** [October 5, 2018, 5:20am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-output-plugin-upsert-without-document-id/151151 "2018-10-05T05:20:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lasitha1991](https://avatars.discourse-cdn.com/v4/letter/l/6de8d8/32.png) [@lasitha1991](https://discuss.elastic.co/u/lasitha1991)\
**Post date:** [October 5, 2018, 5:20am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-output-plugin-upsert-without-document-id/151151/1 "2018-10-05T05:20:51Z")

</div>

Hi, I want to upsert bunch of records to elasticsearch using logstash elasticsearch output plugin. But I can't use the document\_id for this purpose as I want to use \_update\_by\_query option.  
Eg: my document id is created using "%{my\_id\_1}xx%{my\_id\_2}".  
ie. 1xx1, 1xx2, 1xx3, 2xx1, 2xx2 ...

But when updating the records I want to update all the records with the my\_id\_1.  
ie. 1xx1, 1xx2 and 1xx3.

So is there a possibility to update the records using a wild card ( "%{my\_id\_1}xx\*" ) or is there a possibility to update the documents without using the document\_id but the my\_id\_1 as a where clause for the update query

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 5, 2018, 8:25am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-output-plugin-upsert-without-document-id/151151/2 "2018-10-05T08:25:04Z")

</div>

No, as far as I know that is not supported by the Elasticsearch output plugin. You may need a custom script or plugin for that.

---

<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:** [November 2, 2018, 8:25am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-output-plugin-upsert-without-document-id/151151/3 "2018-11-02T08:25:09Z")

</div>

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