# Logstash Exceptionhandling / Catching exceptions from output plugin

**URL:** <https://discuss.elastic.co/t/logstash-exceptionhandling-catching-exceptions-from-output-plugin/28664>\
**Category:** Logstash\
**Created:** [September 4, 2015, 9:08am UTC](https://discuss.elastic.co/t/logstash-exceptionhandling-catching-exceptions-from-output-plugin/28664 "2015-09-04T09:08:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pueffl](https://avatars.discourse-cdn.com/v4/letter/p/9de053/32.png) [@pueffl](https://discuss.elastic.co/u/pueffl)\
**Post date:** [September 4, 2015, 9:08am UTC](https://discuss.elastic.co/t/logstash-exceptionhandling-catching-exceptions-from-output-plugin/28664/1 "2015-09-04T09:08:51Z")

</div>

Hi there!

We are currently evaluating ELK and so far it looks very promising, but we found one big issu we couldn't find satisfying information so far:

We want to log all our events in Elasticsearch, so when something fails here, we want to implement some kind of failover mechanism and save the according data somewhere else, so the basic question is:

**How can we catch Exceptions from an output plugin and handle them?**

Thanks in advance for all suggestions...

Regards,

Wolfgang

---

<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:** [September 4, 2015, 9:49am UTC](https://discuss.elastic.co/t/logstash-exceptionhandling-catching-exceptions-from-output-plugin/28664/2 "2015-09-04T09:49:57Z")

</div>

I don't think there's a good way of dealing with this.

---

<div class="post-metadata">

**Author:** ![Sam\_Saffron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam_saffron/32/44937_2.png) [@Sam\_Saffron](https://discuss.elastic.co/u/Sam_Saffron)\
**Post date:** [September 4, 2015, 10:36am UTC](https://discuss.elastic.co/t/logstash-exceptionhandling-catching-exceptions-from-output-plugin/28664/3 "2015-09-04T10:36:00Z")

</div>

Couldn't you fork the output plugins you are using and then build the exception handling in ruby?

---

<div class="post-metadata">

**Author:** ![pueffl](https://avatars.discourse-cdn.com/v4/letter/p/9de053/32.png) [@pueffl](https://discuss.elastic.co/u/pueffl)\
**Post date:** [September 4, 2015, 11:58am UTC](https://discuss.elastic.co/t/logstash-exceptionhandling-catching-exceptions-from-output-plugin/28664/4 "2015-09-04T11:58:33Z")

</div>

Well, we have no experience with Ruby here and what we want is a general solution. You can probably run into this problem with every output plugin...

---

<div class="post-metadata">

**Author:** ![Sam\_Saffron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam_saffron/32/44937_2.png) [@Sam\_Saffron](https://discuss.elastic.co/u/Sam_Saffron)\
**Post date:** [September 8, 2015, 7:46am UTC](https://discuss.elastic.co/t/logstash-exceptionhandling-catching-exceptions-from-output-plugin/28664/5 "2015-09-08T07:46:12Z")

</div>

Usually you only need 1/2 output plugins though, in our setup all we use is an elastic and graphite output... should not be to hard to hack 2 outputs really for extra logging / etc.

---

<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:29am UTC](https://discuss.elastic.co/t/logstash-exceptionhandling-catching-exceptions-from-output-plugin/28664/6 "2017-07-06T05:29:47Z")

</div>


