# Logstash-filter-rest Client Error

**URL:** <https://discuss.elastic.co/t/logstash-filter-rest-client-error/150083>\
**Category:** Logstash\
**Created:** [September 26, 2018, 8:15pm UTC](https://discuss.elastic.co/t/logstash-filter-rest-client-error/150083 "2018-09-26T20:15:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sid\_Sathi](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@Sid\_Sathi](https://discuss.elastic.co/u/Sid_Sathi)\
**Post date:** [September 26, 2018, 8:15pm UTC](https://discuss.elastic.co/t/logstash-filter-rest-client-error/150083/1 "2018-09-26T20:15:59Z")

</div>

I installed logstash-filter-rest plugin in to make an post request to a webservice but I am getting the following error.

[ERROR][logstash.filters.rest] error in rest filter  
:client\_error=\>#\<Manticore::SocketException: Connection refused (Connection refused)\>}

What does this mean?

Weirdly enough, the connection works fine on my local system but this issue only comes up when I create a docker compose file for the different services (ES, Logstash, Kibana, and Flask web server). I'm a bit new to these tools so any help would be greatly appreciated. Below is filter portion of my config file.

filter {  
rest {  
request =\> {  
url =\> '[http://0.0.0.0:5000/predict](http://0.0.0.0:5000/predict)'  
method =\> "post"  
params =\> {  
"submit" =\> "%{tweet\_content}"  
}  
headers =\> { "Content-Type" =\> "application/json" }  
}  
target =\> 'rest'  
}  
}

The web service is indeed running at 0.0.0.0:5000/predict

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [September 26, 2018, 10:39pm UTC](https://discuss.elastic.co/t/logstash-filter-rest-client-error/150083/2 "2018-09-26T22:39:16Z")

</div>

Is it running on that docker container's port 5000, or on your local machine's port 5000? You may need to expose that local port to your docker container.

---

<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 27, 2018, 6:17am UTC](https://discuss.elastic.co/t/logstash-filter-rest-client-error/150083/3 "2018-09-27T06:17:40Z")

</div>

> The web service is indeed running at 0.0.0.0:5000/predict

Sure, but 0.0.0.0 isn't an address you can connect to. It's possible to _listen_ on that address (it means to listen on all available interfaces) but when you connect you need to pick an exact IP address (or hostname).

---

<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:** [October 25, 2018, 6:17am UTC](https://discuss.elastic.co/t/logstash-filter-rest-client-error/150083/4 "2018-10-25T06:17:50Z")

</div>

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