# Retry Logstash Input if it Fails

**URL:** <https://discuss.elastic.co/t/retry-logstash-input-if-it-fails/36092>\
**Category:** Logstash\
**Created:** [December 1, 2015, 8:06pm UTC](https://discuss.elastic.co/t/retry-logstash-input-if-it-fails/36092 "2015-12-01T20:06:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeromefroe](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@jeromefroe](https://discuss.elastic.co/u/jeromefroe)\
**Post date:** [December 1, 2015, 8:06pm UTC](https://discuss.elastic.co/t/retry-logstash-input-if-it-fails/36092/1 "2015-12-01T20:06:24Z")

</div>

I'm currently using the jdbc plug-in to ingest data from an Oracle database into Elasticsearch every hour on the hour. I've noticed that sometimes the data fails to be ingested and when I check the logstash log file I see an error similar to the one below:

`{:timestamp=>"2015-11-28T08:00:00.309000-0500", :message=>"Exception when executing JDBC query", :exception=>#<Sequel::DatabaseDisconnectError: Java::JavaSql::SQLRecoverableException: Closed Connection>, :level=>:warn}`

It appears the logstash input failed because of a connection error, but I was wondering if there was a way to tell logstash to retry an input a certain number of times? So, for example, if it fails logstash might try again two more times. Thanks!

---

<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:** [December 1, 2015, 9:22pm UTC](https://discuss.elastic.co/t/retry-logstash-input-if-it-fails/36092/2 "2015-12-01T21:22:28Z")

</div>

You'll have to raise a feature request against this plugin for that sort of thing 🙂

---

<div class="post-metadata">

**Author:** ![jeromefroe](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@jeromefroe](https://discuss.elastic.co/u/jeromefroe)\
**Post date:** [December 1, 2015, 9:52pm UTC](https://discuss.elastic.co/t/retry-logstash-input-if-it-fails/36092/3 "2015-12-01T21:52:04Z")

</div>

Thanks Mark, will do!

---

<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:20am UTC](https://discuss.elastic.co/t/retry-logstash-input-if-it-fails/36092/4 "2017-07-06T05:20:28Z")

</div>


