# Logstash closes after reading ES index

**URL:** <https://discuss.elastic.co/t/logstash-closes-after-reading-es-index/24114>\
**Category:** Logstash\
**Created:** [June 22, 2015, 4:33pm UTC](https://discuss.elastic.co/t/logstash-closes-after-reading-es-index/24114 "2015-06-22T16:33:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vilas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vilas/32/613_2.png) [@vilas](https://discuss.elastic.co/u/vilas)\
**Post date:** [June 22, 2015, 4:33pm UTC](https://discuss.elastic.co/t/logstash-closes-after-reading-es-index/24114/1 "2015-06-22T16:33:07Z")

</div>

Hi,

I am trying to read an ES index. But I observe that Logstash closes immediately after reading the ES index. But I would like Logstash to wait for new records into ES. Is it the common behavior with ES as input to Logstash?

Please clarify.

Thanks.

---

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [June 23, 2015, 3:57am UTC](https://discuss.elastic.co/t/logstash-closes-after-reading-es-index/24114/2 "2015-06-23T03:57:40Z")

</div>

Well Elasticsearch does not "wait" for new documents, it has to query (Scrolls help it not repeat the entire search)

You may want to look at watcher which is a new product by ES that might help you out.

---

<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:** [June 23, 2015, 5:50am UTC](https://discuss.elastic.co/t/logstash-closes-after-reading-es-index/24114/3 "2015-06-23T05:50:53Z")

</div>

This is also relevant - [https://github.com/elastic/elasticsearch/issues/1242](https://github.com/elastic/elasticsearch/issues/1242)

---

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [June 24, 2015, 2:37am UTC](https://discuss.elastic.co/t/logstash-closes-after-reading-es-index/24114/4 "2015-06-24T02:37:14Z")

</div>

Interesting discussion. Yes event oriented notifications would be nice! If I get the gist of the thread.

I guess it depends on how many connections your dealing with. I mean if we are worrying about 10 to 100 connections per minute it really is not a strain on client or server. but if your talking about a million or more then that is another story.

---

<div class="post-metadata">

**Author:** ![vilas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vilas/32/613_2.png) [@vilas](https://discuss.elastic.co/u/vilas)\
**Post date:** [June 24, 2015, 6:53pm UTC](https://discuss.elastic.co/t/logstash-closes-after-reading-es-index/24114/5 "2015-06-24T18:53:46Z")

</div>

> [@eperry](#):
>
> Well Elasticsearch does not "wait" for new documents

I was wondering why Elasticsearch doesn't wait for new documents? Can we do something to achieve that using Logstash?

> [@eperry](#):
>
> You may want to look at watcher which is a new product by ES that might help you out.

I have already tried using watcher few days back. It is a very good product. We are considering the same. But we currently do posses in house alerting system which we would like to leverage on before we take such a decision to go with watcher.  
Is there a possibility that I can wait on ES using Logstash?

> [@warkolm](#):
>
> This is also relevant - [Changes API · Issue #1242 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues/1242)

I am still trying to follow the discussion.

---

<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:** [July 6, 2017, 5:36am UTC](https://discuss.elastic.co/t/logstash-closes-after-reading-es-index/24114/6 "2017-07-06T05:36:36Z")

</div>


