# Can't send data to logstash via tcp port 5959

**URL:** <https://discuss.elastic.co/t/cant-send-data-to-logstash-via-tcp-port-5959/228758>\
**Category:** Logstash\
**Created:** [April 19, 2020, 7:17pm UTC](https://discuss.elastic.co/t/cant-send-data-to-logstash-via-tcp-port-5959/228758 "2020-04-19T19:17:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilang](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@ilang](https://discuss.elastic.co/u/ilang)\
**Post date:** [April 19, 2020, 7:17pm UTC](https://discuss.elastic.co/t/cant-send-data-to-logstash-via-tcp-port-5959/228758/1 "2020-04-19T19:17:26Z")

</div>

Hi guys,

I am trying to send to logstash using tcp port,

It is working when the code is running on localhost,

however, it should also run remotely.

Maybe I need to use different plugin? (or just try to use rest api?)

When I run: netstat -plnt  
I can see port 5959 is not available from outside the server:

tcp6 0 0 :::5959 :::\* LISTEN 6400/java

logstash config file is:

input {  
tcp {  
port =\> 5959  
codec =\> json  
}  
}  
output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "tests"  
user =\> "elastic"  
password =\> "xxxxxx"  
}

stdout {  
codec =\> rubydebug  
}  
}

your help is appreciated 🙂

---

<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:** [May 17, 2020, 7:17pm UTC](https://discuss.elastic.co/t/cant-send-data-to-logstash-via-tcp-port-5959/228758/2 "2020-05-17T19:17:29Z")

</div>

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