# Prevent Logstash from stopping

**URL:** <https://discuss.elastic.co/t/prevent-logstash-from-stopping/55295>\
**Category:** Logstash\
**Created:** [July 12, 2016, 1:58pm UTC](https://discuss.elastic.co/t/prevent-logstash-from-stopping/55295 "2016-07-12T13:58:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NicoYUE](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@NicoYUE](https://discuss.elastic.co/u/NicoYUE)\
**Post date:** [July 12, 2016, 1:58pm UTC](https://discuss.elastic.co/t/prevent-logstash-from-stopping/55295/1 "2016-07-12T13:58:35Z")

</div>

Hello,

I currently use Logstash to retrieve data from a SQL Database and send it my Elasticsearch cluster.

I run Logstash with a command line (service won't work but it's another issue):

/opt/logstash/bin/logstash --config /etc/logstash/conf.d/logstash.conf

My problem is that whenever Logstash reaches the end of my SQL Database, it stops running and I won't be able to read new entries automatically and I want to keep it running so it'll read them and send them to Elasticsearch.

I guess I'm missing something in my configuration and I can't find what it is :

input {  
jdbc {  
jdbc\_connection\_string =\> "jdbc:jtds:sqlserver: xxx  
jdbc\_user =\> "xxx"  
jdbc\_password =\> "xxx$$"  
jdbc\_validate\_connection =\> true  
jdbc\_driver\_library =\> "/root/jtds-1.3.1.jar"  
jdbc\_driver\_class =\> "Java::net.sourceforge.jtds.jdbc.Driver"  
statement =\> "xxx"  
}

}

output {  
elasticsearch {  
hosts =\> ["host:9200"]  
index =\> "event-%{+YYYY.MM.dd}  
}  
}

Thank you,

---

<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:** [July 13, 2016, 4:06am UTC](https://discuss.elastic.co/t/prevent-logstash-from-stopping/55295/2 "2016-07-13T04:06:55Z")

</div>

I think [https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#\_scheduling](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#_scheduling) will get what you want

---

<div class="post-metadata">

**Author:** ![NicoYUE](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@NicoYUE](https://discuss.elastic.co/u/NicoYUE)\
**Post date:** [July 13, 2016, 8:24am UTC](https://discuss.elastic.co/t/prevent-logstash-from-stopping/55295/3 "2016-07-13T08:24:55Z")

</div>

Oh yes, that's it, thank you. I completely forgot about the scheduling part.

---

<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, 4:48am UTC](https://discuss.elastic.co/t/prevent-logstash-from-stopping/55295/4 "2017-07-06T04:48:16Z")

</div>


