# Update indexed docs based on a value from a new doc still does not indexed

**URL:** <https://discuss.elastic.co/t/update-indexed-docs-based-on-a-value-from-a-new-doc-still-does-not-indexed/250478>\
**Category:** Logstash\
**Created:** [September 30, 2020, 10:19am UTC](https://discuss.elastic.co/t/update-indexed-docs-based-on-a-value-from-a-new-doc-still-does-not-indexed/250478 "2020-09-30T10:19:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcelo\_Lavor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcelo_lavor/32/76414_2.png) [@Marcelo\_Lavor](https://discuss.elastic.co/u/Marcelo_Lavor)\
**Post date:** [September 30, 2020, 10:19am UTC](https://discuss.elastic.co/t/update-indexed-docs-based-on-a-value-from-a-new-doc-still-does-not-indexed/250478/1 "2020-09-30T10:19:02Z")

</div>

Hello! I need to update several docs into an old index based on a value of new records still do not indexed? Is there any way to implement it with Logstash?

This table below describes my index with old docs. The yellow line would be a new doc arriving.

RULE: As far the latest entry is received (NEW "not indexed entry") with STATE=OFF, all respective older entries of Group 1 (FROM EXISTING INDEX) must be set COLOR=RED

![image](https://us1.discourse-cdn.com/elastic/original/3X/3/b/3b1fc612799a94002d0be7c52acb8c966c8e8564.png)

Could you please let me know any example with logstash?

---

<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 30, 2020, 1:11pm UTC](https://discuss.elastic.co/t/update-indexed-docs-based-on-a-value-from-a-new-doc-still-does-not-indexed/250478/2 "2020-09-30T13:11:56Z")

</div>

You could use [Update by Query](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html) and an http output that posts to elasticsearch. There is an example [here](https://discuss.elastic.co/t/logstash-performance-comparison-update-by-query-v-s-pulling-data-from-db-via-sql/225308).

---

<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:** [October 28, 2020, 1:12pm UTC](https://discuss.elastic.co/t/update-indexed-docs-based-on-a-value-from-a-new-doc-still-does-not-indexed/250478/3 "2020-10-28T13:12:02Z")

</div>

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