Logstash-filter-rest Client Error


(Sid Sathi) #1

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'
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


(Ry Biesemeyer) #2

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.


(Magnus B├Ąck) #3

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).


(system) #4

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