# Logstash how to end and start a new instance

**URL:** <https://discuss.elastic.co/t/logstash-how-to-end-and-start-a-new-instance/140712>\
**Category:** Logstash\
**Created:** [July 19, 2018, 11:43am UTC](https://discuss.elastic.co/t/logstash-how-to-end-and-start-a-new-instance/140712 "2018-07-19T11:43:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jack\_McAleese](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jack\_McAleese](https://discuss.elastic.co/u/Jack_McAleese)\
**Post date:** [July 19, 2018, 11:43am UTC](https://discuss.elastic.co/t/logstash-how-to-end-and-start-a-new-instance/140712/1 "2018-07-19T11:43:30Z")

</div>

Hi! I am new to ELK, hopefully someone can understand my problem here.

I've ingested data via logstash into elasticsearch, but I need to clear all of that data and re-ingest it.

My goal is to time how long it takes to ingest a large data set using Logstash, but when I try to ingest the same data set again I get the message 'Logstash could not be started because there is already another instance using the configured data directory.' Using bash.

Thank you!

---

<div class="post-metadata">

**Author:** ![Jack\_McAleese](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jack\_McAleese](https://discuss.elastic.co/u/Jack_McAleese)\
**Post date:** [July 19, 2018, 11:44am UTC](https://discuss.elastic.co/t/logstash-how-to-end-and-start-a-new-instance/140712/2 "2018-07-19T11:44:01Z")

</div>

How do I just start anew?

---

<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:** [July 19, 2018, 6:45pm UTC](https://discuss.elastic.co/t/logstash-how-to-end-and-start-a-new-instance/140712/3 "2018-07-19T18:45:53Z")

</div>

Shut down any running Logstash instances, delete any indexes in ES, and delete any sincedb files. See the file input documentation for more on where the sincedb files are located.

---

<div class="post-metadata">

**Author:** ![Jack\_McAleese](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jack\_McAleese](https://discuss.elastic.co/u/Jack_McAleese)\
**Post date:** [July 20, 2018, 9:04am UTC](https://discuss.elastic.co/t/logstash-how-to-end-and-start-a-new-instance/140712/4 "2018-07-20T09:04:38Z")

</div>

How do I shut down any running Logstash instances? I close Terminal and hit "terminate processes," but am still met with the same problem.

Thus, I have resulted to restarting my Mac every time this error happens. This works but is incredibly time-consuming.

Thank you

---

<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:** [July 20, 2018, 10:06am UTC](https://discuss.elastic.co/t/logstash-how-to-end-and-start-a-new-instance/140712/5 "2018-07-20T10:06:37Z")

</div>

How are you starting Logstash in the first place?

---

<div class="post-metadata">

**Author:** ![Jack\_McAleese](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jack\_McAleese](https://discuss.elastic.co/u/Jack_McAleese)\
**Post date:** [July 20, 2018, 10:45am UTC](https://discuss.elastic.co/t/logstash-how-to-end-and-start-a-new-instance/140712/6 "2018-07-20T10:45:17Z")

</div>

Terminal (bash) on Mac. Using this command:

'bin/logstash -f /Users/user/Desktop/data/sampledata.config'

It works once or twice after restarting, but then gives me the 'another instance' error message. As I mentioned, I am not very experienced with this software, but need to test and ingest a lot of data.

Thank you!

---

<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:** [July 20, 2018, 5:38pm UTC](https://discuss.elastic.co/t/logstash-how-to-end-and-start-a-new-instance/140712/7 "2018-07-20T17:38:07Z")

</div>

Hitting Ctrl+C should abort that process cleanly, but in any case the "Logstash could not be started because there is already another instance using the configured data directory" error happens when there's a lockfile in the data subdirectory. Normally that file shouldn't be left behind, but if it is and you really don't have any Logstash instances running you can delete the file.

---

<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:** [August 17, 2018, 5:38pm UTC](https://discuss.elastic.co/t/logstash-how-to-end-and-start-a-new-instance/140712/8 "2018-08-17T17:38:20Z")

</div>

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