# How to close the Loading of data by logstash programmatically

**URL:** <https://discuss.elastic.co/t/how-to-close-the-loading-of-data-by-logstash-programmatically/43522>\
**Category:** Logstash\
**Created:** [March 4, 2016, 3:17pm UTC](https://discuss.elastic.co/t/how-to-close-the-loading-of-data-by-logstash-programmatically/43522 "2016-03-04T15:17:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajeev\_Gaurav](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@Rajeev\_Gaurav](https://discuss.elastic.co/u/Rajeev_Gaurav)\
**Post date:** [March 4, 2016, 3:17pm UTC](https://discuss.elastic.co/t/how-to-close-the-loading-of-data-by-logstash-programmatically/43522/1 "2016-03-04T15:17:35Z")

</div>

Hi,

I am loading the data in ES using Logstash pro grammatically by starting the process cmd.exe.But I am not able to close this loading of data . can you help me that How can i shutdown logsatsh programmatically.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 4, 2016, 6:21pm UTC](https://discuss.elastic.co/t/how-to-close-the-loading-of-data-by-logstash-programmatically/43522/2 "2016-03-04T18:21:17Z")

</div>

If you know Logstash is done processing the data, just kill the process. Depending on which language you're using you might be able to interrupt it in a graceful way (similar to SIGINT on a Unix-like system), otherwise it'll be a hard shutdown.

---

<div class="post-metadata">

**Author:** ![Rajeev\_Gaurav](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@Rajeev\_Gaurav](https://discuss.elastic.co/u/Rajeev_Gaurav)\
**Post date:** [March 4, 2016, 10:06pm UTC](https://discuss.elastic.co/t/how-to-close-the-loading-of-data-by-logstash-programmatically/43522/3 "2016-03-04T22:06:54Z")

</div>

Is there any way to know the size of index programmatically .Right now I am trying "[http://localhost:9200/\_cat/indices?h=index,store.size](http://localhost:9200/_cat/indices?h=index,store.size)" which give size upto one decimal (For eg 2.6 for both 2.60 and 2.66). so Kindly suggest some points with this also.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 6, 2016, 1:55pm UTC](https://discuss.elastic.co/t/how-to-close-the-loading-of-data-by-logstash-programmatically/43522/4 "2016-03-06T13:55:10Z")

</div>

You'll have better luck asking about index sizes in the Elasticsearch category. I have no straight answer.

---

<div class="post-metadata">

**Author:** ![Rajeev\_Gaurav](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@Rajeev\_Gaurav](https://discuss.elastic.co/u/Rajeev_Gaurav)\
**Post date:** [March 7, 2016, 5:07am UTC](https://discuss.elastic.co/t/how-to-close-the-loading-of-data-by-logstash-programmatically/43522/5 "2016-03-07T05:07:35Z")

</div>

Thanks for all the response. I got the answer. This URL "[http://localhost:9200/\_cat/indices?h=index,store.size&bytes=b](http://localhost:9200/_cat/indices?h=index,store.size&bytes=b)" Will give the size in bytes and pretty much solve my issue.

---

<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:08am UTC](https://discuss.elastic.co/t/how-to-close-the-loading-of-data-by-logstash-programmatically/43522/6 "2017-07-06T05:08:13Z")

</div>

Closed on July 6, 2017, 5:08am UTC


