# TCP output reconnect interval setting

**URL:** <https://discuss.elastic.co/t/tcp-output-reconnect-interval-setting/90885>\
**Category:** Logstash\
**Created:** [June 26, 2017, 11:34pm UTC](https://discuss.elastic.co/t/tcp-output-reconnect-interval-setting/90885 "2017-06-26T23:34:20Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![s802645](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@s802645](https://discuss.elastic.co/u/s802645)\
**Post date:** [June 26, 2017, 11:34pm UTC](https://discuss.elastic.co/t/tcp-output-reconnect-interval-setting/90885/1 "2017-06-26T23:34:20Z")

</div>

The reconnect interval setting for TCP output plugin is by default 10. What would happen if I set it to 0. Does it mean logstash would not attempt to reconnect to the destination at all?  
thanks.

---

<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:** [June 27, 2017, 8:07pm UTC](https://discuss.elastic.co/t/tcp-output-reconnect-interval-setting/90885/2 "2017-06-27T20:07:58Z")

</div>

No, it means that it would attempt to reconnect _immediately_ after the disconnect.

> <https://github.com/logstash-plugins/logstash-output-tcp/blob/v4.0.1/lib/logstash/outputs/tcp.rb#L166-L173>

---

<div class="post-metadata">

**Author:** ![s802645](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@s802645](https://discuss.elastic.co/u/s802645)\
**Post date:** [June 28, 2017, 2:11am UTC](https://discuss.elastic.co/t/tcp-output-reconnect-interval-setting/90885/3 "2017-06-28T02:11:01Z")

</div>

how do you configure this tcp output to ignore the connection if the destination is not up? I have encountered an issue whereby my logstash would not write to local file at the same time when the destination is not up. i.e. I am sending a copy of the log to file as well as to destination.  
thanks

---

<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:** [June 28, 2017, 3:35am UTC](https://discuss.elastic.co/t/tcp-output-reconnect-interval-setting/90885/4 "2017-06-28T03:35:43Z")

</div>

Logstash does not have configurable "ignore" behavior. If one output pushes back because of errors the whole pipeline is stalled.

---

<div class="post-metadata">

**Author:** ![s802645](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@s802645](https://discuss.elastic.co/u/s802645)\
**Post date:** [June 28, 2017, 5:49am UTC](https://discuss.elastic.co/t/tcp-output-reconnect-interval-setting/90885/5 "2017-06-28T05:49:30Z")

</div>

Thanks. What could be a workaround for this kind of situation?

---

<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:** [June 28, 2017, 6:05am UTC](https://discuss.elastic.co/t/tcp-output-reconnect-interval-setting/90885/6 "2017-06-28T06:05:40Z")

</div>

You could solve it by posting events to a queue that separate Logstash instances subscribe to. If one of the instances is having issues its events will remain in the queue until things have cleared up.

---

<div class="post-metadata">

**Author:** ![s802645](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@s802645](https://discuss.elastic.co/u/s802645)\
**Post date:** [July 2, 2017, 10:47pm UTC](https://discuss.elastic.co/t/tcp-output-reconnect-interval-setting/90885/7 "2017-07-02T22:47:39Z")

</div>

Thanks how do we run a separate instance of logstash?

---

<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 3, 2017, 5:27am UTC](https://discuss.elastic.co/t/tcp-output-reconnect-interval-setting/90885/8 "2017-07-03T05:27:56Z")

</div>

The details depends on how you're currently running Logstash, but in the end you'll have to run two Logstash processes with their own data directory, their own log directory, and their own set of configuration files.

---

<div class="post-metadata">

**Author:** ![s802645](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@s802645](https://discuss.elastic.co/u/s802645)\
**Post date:** [July 3, 2017, 7:08am UTC](https://discuss.elastic.co/t/tcp-output-reconnect-interval-setting/90885/9 "2017-07-03T07:08:17Z")

</div>

Thanks. I guess when I start the second instance, the port number for syslog would be different as well, am i correct to say that? since port 514 is already binded by the first instance.  
thanks.

---

<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 3, 2017, 7:43am UTC](https://discuss.elastic.co/t/tcp-output-reconnect-interval-setting/90885/10 "2017-07-03T07:43:06Z")

</div>

Why would you even have a second syslog listener?

---

<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 31, 2017, 7:43am UTC](https://discuss.elastic.co/t/tcp-output-reconnect-interval-setting/90885/11 "2017-07-31T07:43:23Z")

</div>

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