# Logstash Tcp output does not working

**URL:** <https://discuss.elastic.co/t/logstash-tcp-output-does-not-working/77750>\
**Category:** Logstash\
**Created:** [March 8, 2017, 3:21am UTC](https://discuss.elastic.co/t/logstash-tcp-output-does-not-working/77750 "2017-03-08T03:21:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjuzhj23](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mjuzhj23/32/16162_2.png) [@mjuzhj23](https://discuss.elastic.co/u/mjuzhj23)\
**Post date:** [March 8, 2017, 3:21am UTC](https://discuss.elastic.co/t/logstash-tcp-output-does-not-working/77750/1 "2017-03-08T03:21:11Z")

</div>

Log stash 5.0.0 does not working after "Failed (Connection refused - Connection refused). Sleeping for 2.0" message.

I was checking for an error situation.

1. "A" tcp server working on 9812 port..
2. log stash output to A tcp server (it works.)
3. Suddenly i kill "A" server
4. then log stash print "Failed (Connection refused - Connection refused). Sleeping for x.x" message
5. Restart A in the same way as environment # 1.
6. finally log stash does not working......T^T

# logstash.conf

* * *

input {  
file {  
#start\_position =\> "beginning"  
start\_position =\> "end"  
path =\> ["/data/app\_logs/api.log"]  
codec =\> "json"  
}  
}  
filter {  
mutate {  
remove\_field =\> ["[headers][cookie]" ]  
}  
}  
output {  
tcp {  
host =\> "IP"  
port =\> "9812"  
codec =\> json\_lines  
}

## stdout { codec =\> rubydebug } }

How can i fix it this issue...

---

<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:** [April 5, 2017, 3:21am UTC](https://discuss.elastic.co/t/logstash-tcp-output-does-not-working/77750/2 "2017-04-05T03:21:31Z")

</div>

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