# Update document in elasticsearch

**URL:** <https://discuss.elastic.co/t/update-document-in-elasticsearch/150510>\
**Category:** Elasticsearch\
**Created:** [October 1, 2018, 5:17am UTC](https://discuss.elastic.co/t/update-document-in-elasticsearch/150510 "2018-10-01T05:17:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![richagautam](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@richagautam](https://discuss.elastic.co/u/richagautam)\
**Post date:** [October 1, 2018, 5:17am UTC](https://discuss.elastic.co/t/update-document-in-elasticsearch/150510/1 "2018-10-01T05:17:09Z")

</div>

Hi Team,

I have used logstash to parse the log file then using elasticsearch to save the index and kibana to visualize it.

My problem is that for a particular log file (Path) i am getting value of one filed only once and for rest of the rows, for same file(Path), i want to update that filed with the same value which i got in one of the record.

sample sql query:

update Path A set A.Filed = B.Filed  
from Path A, Path B  
where A.Path = B.Path and A.Filed = null.

Is it possible to update it in elasticsearch using kibana dev tool or how can i achieve this. Any sample query to handle such type of situation

Thanks

---

<div class="post-metadata">

**Author:** ![richagautam](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@richagautam](https://discuss.elastic.co/u/richagautam)\
**Post date:** [October 3, 2018, 11:40am UTC](https://discuss.elastic.co/t/update-document-in-elasticsearch/150510/2 "2018-10-03T11:40:11Z")

</div>

Hi,

Any suggestion for above scenario.  
Can i update it in logstash using ruby filter

---

<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:** [October 4, 2018, 3:44am UTC](https://discuss.elastic.co/t/update-document-in-elasticsearch/150510/3 "2018-10-04T03:44:20Z")

</div>

You cannot do this with a query, you would need to do it before you sent it to Elasticsearch for indexing.

---

<div class="post-metadata">

**Author:** ![richagautam](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@richagautam](https://discuss.elastic.co/u/richagautam)\
**Post date:** [October 4, 2018, 5:05am UTC](https://discuss.elastic.co/t/update-document-in-elasticsearch/150510/4 "2018-10-04T05:05:51Z")

</div>

Thanks for the confirmation.

Can I update it in logstash using Ruby filter.

Thanks

---

<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 1, 2018, 5:05am UTC](https://discuss.elastic.co/t/update-document-in-elasticsearch/150510/5 "2018-11-01T05:05:53Z")

</div>

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