# Handle concurrency while updating different records of the same id from json file

**URL:** <https://discuss.elastic.co/t/handle-concurrency-while-updating-different-records-of-the-same-id-from-json-file/366318>\
**Category:** Logstash\
**Created:** [September 10, 2024, 1:21pm UTC](https://discuss.elastic.co/t/handle-concurrency-while-updating-different-records-of-the-same-id-from-json-file/366318 "2024-09-10T13:21:25Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [September 10, 2024, 2:47pm UTC](https://discuss.elastic.co/t/handle-concurrency-while-updating-different-records-of-the-same-id-from-json-file/366318/3 "2024-09-10T14:47:07Z")

</div>

If there are multiple records which contain a unique record identifier then you can combine them using an aggregate filter. This requires every event go through a single pipeline worker thread, so that they are all processed by a single filter instance.

If the records for an employee all have disparate data then you could have elasticsearch combine them. That is, if there are records for languages, addresses, shoe size, age, etc., but a record never contains both shoe size and address, then you can have logstash write out a file that updates each field using doc\_as\_upsert and feed that file to elasticsearch using curl (or Invoke-WebRequest on Windows). A little more detail [here](https://discuss.elastic.co/t/aggregate-problem/142572/7).

Given that I implemented that using a file output and curl I have to assume that having an elasticsearch output do the equivalent doc\_as\_upsert does not work the way I wanted it to.

---

_[View the full topic](https://discuss.elastic.co/t/handle-concurrency-while-updating-different-records-of-the-same-id-from-json-file/366318)._
