# Logstash verify output availability

**URL:** <https://discuss.elastic.co/t/logstash-verify-output-availability/61396>\
**Category:** Logstash\
**Created:** [September 23, 2016, 2:56pm UTC](https://discuss.elastic.co/t/logstash-verify-output-availability/61396 "2016-09-23T14:56:13Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joao\_Paulo\_Karol\_Nun](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@Joao\_Paulo\_Karol\_Nun](https://discuss.elastic.co/u/Joao_Paulo_Karol_Nun)\
**Post date:** [September 23, 2016, 2:56pm UTC](https://discuss.elastic.co/t/logstash-verify-output-availability/61396/1 "2016-09-23T14:56:13Z")

</div>

Hi all,  
I wonder if there is a way to verify if a tool (elasticSearch etc) defined in the output filter is available before sending messages.  
The reason is because logstash is hanging when an output is not available and cannot follow the other output flows;  
Does anyone have any idea?

---

<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 26, 2016, 1:06pm UTC](https://discuss.elastic.co/t/logstash-verify-output-availability/61396/2 "2016-09-26T13:06:20Z")

</div>

> I wonder if there is a way to verify if a tool (elasticSearch etc) defined in the output filter is available before sending messages.

Sending messages from where?

> The reason is because logstash is hanging when an output is not available and cannot follow the other output flows;

Yes, this is by design. Logstash requires all outputs to accept events, Otherwise the pipeline will pause.

It might be easier to help if you explain the bigger picture of what you're trying to do.

---

<div class="post-metadata">

**Author:** ![Joao\_Paulo\_Karol\_Nun](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@Joao\_Paulo\_Karol\_Nun](https://discuss.elastic.co/u/Joao_Paulo_Karol_Nun)\
**Post date:** [September 26, 2016, 2:18pm UTC](https://discuss.elastic.co/t/logstash-verify-output-availability/61396/3 "2016-09-26T14:18:05Z")

</div>

Hi Magnus,  
At some deployment environments, the output hosts defined will NOT be available, but I sill want logstash to send data to the other output hosts defined.  
My logstash output filter should be smart enough to ignore sending message if a server is down.

---

<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 26, 2016, 2:22pm UTC](https://discuss.elastic.co/t/logstash-verify-output-availability/61396/4 "2016-09-26T14:22:04Z")

</div>

Logstash currently doesn't support this scenario. You'd have to temporarily disable those outputs.

---

<div class="post-metadata">

**Author:** ![Joao\_Paulo\_Karol\_Nun](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@Joao\_Paulo\_Karol\_Nun](https://discuss.elastic.co/u/Joao_Paulo_Karol_Nun)\
**Post date:** [September 26, 2016, 2:54pm UTC](https://discuss.elastic.co/t/logstash-verify-output-availability/61396/5 "2016-09-26T14:54:36Z")

</div>

I was thinking I could create a custom output plugin and change the code to check the host is up.  
What do you think?

---

<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 26, 2016, 2:58pm UTC](https://discuss.elastic.co/t/logstash-verify-output-availability/61396/6 "2016-09-26T14:58:33Z")

</div>

I don't understand what you mean. How would it help to have a custom output plugin that checks whether the server is up?

---

<div class="post-metadata">

**Author:** ![Joao\_Paulo\_Karol\_Nun](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@Joao\_Paulo\_Karol\_Nun](https://discuss.elastic.co/u/Joao_Paulo_Karol_Nun)\
**Post date:** [September 26, 2016, 3:09pm UTC](https://discuss.elastic.co/t/logstash-verify-output-availability/61396/7 "2016-09-26T15:09:29Z")

</div>

I am currently using a syslog output plugin.  
Checking its ruby code (syslog.rb) I can see the connection code.  
I was thinking I could change the code to ignore when the destination is not available and continues the output pipeline event flow.

---

<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 26, 2016, 3:11pm UTC](https://discuss.elastic.co/t/logstash-verify-output-availability/61396/8 "2016-09-26T15:11:22Z")

</div>

Oh, you mean modify an existing plugin to return success even though it failed? Sure, that'd work.

---

<div class="post-metadata">

**Author:** ![Joao\_Paulo\_Karol\_Nun](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@Joao\_Paulo\_Karol\_Nun](https://discuss.elastic.co/u/Joao_Paulo_Karol_Nun)\
**Post date:** [September 26, 2016, 3:12pm UTC](https://discuss.elastic.co/t/logstash-verify-output-availability/61396/9 "2016-09-26T15:12:37Z")

</div>

Yes that is what I mean. Thanks, let me see if I can get it working.

---

<div class="post-metadata">

**Author:** ![Divya\_Prakash](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@Divya\_Prakash](https://discuss.elastic.co/u/Divya_Prakash)\
**Post date:** [June 9, 2017, 6:28am UTC](https://discuss.elastic.co/t/logstash-verify-output-availability/61396/10 "2017-06-09T06:28:38Z")

</div>

Hello, we are also facing same issue with Logstash 5.4.0 as well..Wondering if there is any fix available for this yet?

---

<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:** [November 4, 2022, 4:28am UTC](https://discuss.elastic.co/t/logstash-verify-output-availability/61396/11 "2022-11-04T04:28:56Z")

</div>


