# Use logstash to "read" from index when ingesting new data to calculate a field

**URL:** https://discuss.elastic.co/t/use-logstash-to-read-from-index-when-ingesting-new-data-to-calculate-a-field/100693
**Category:** Logstash
**Created:** [September 15, 2017, 1:51pm UTC](https://discuss.elastic.co/t/use-logstash-to-read-from-index-when-ingesting-new-data-to-calculate-a-field/100693 "2017-09-15T13:51:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Cristian](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@Cristian](https://discuss.elastic.co/u/Cristian)
#### Post date: [September 15, 2017, 1:51pm UTC](https://discuss.elastic.co/t/use-logstash-to-read-from-index-when-ingesting-new-data-to-calculate-a-field/100693/1 "2017-09-15T13:51:35Z")

</div>

Hi All,  
Sorry for the bad heading. I have a question. Is it possible to read from an index when ingesting data to calculate a field?

I have some daily data that I ingest into an index. Now I want to use one of the fields to compare (do a calculation) it to previous data (from earlier days) that resides in the index. That means that I need to read from the index when ingesting the data. The output is a calculated field.  
Is this possible?

Br  
Cris

---

<div class="post-metadata">

### Author: ![Rom1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rom1/32/49699_2.png) [@Rom1](https://discuss.elastic.co/u/Rom1)
#### Post date: [September 17, 2017, 1:54pm UTC](https://discuss.elastic.co/t/use-logstash-to-read-from-index-when-ingesting-new-data-to-calculate-a-field/100693/2 "2017-09-17T13:54:19Z")

</div>

Hi Cristian,

Have a look to this filter: [logstash-filter-elasticsearch](https://www.elastic.co/guide/en/logstash/current/plugins-filters-elasticsearch.html)

Regards  
Romain

---

<div class="post-metadata">

### Author: ![Cristian](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@Cristian](https://discuss.elastic.co/u/Cristian)
#### Post date: [September 29, 2017, 8:47am UTC](https://discuss.elastic.co/t/use-logstash-to-read-from-index-when-ingesting-new-data-to-calculate-a-field/100693/3 "2017-09-29T08:47:19Z")

</div>

Thank you! Testing it.

---

<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 27, 2017, 8:47am UTC](https://discuss.elastic.co/t/use-logstash-to-read-from-index-when-ingesting-new-data-to-calculate-a-field/100693/4 "2017-10-27T08:47:24Z")

</div>

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