Http Output 307 not being redirected

I'm using an http output plugin to push events to EventStore. I am unable to get a successful POST and get an failure do to a 307 http status code. I've found several postings indicating that the http output plugin should be following the redirect and I have set the follow_redirects = true. Any help understanding why this is not working would be helpful. The experiment can be found here https://github.com/Insanityisnice/logstash-rabbit-to-eventstore. I'm using docker to host everything, instructions are in the readme.md

The config file:
input {
rabbitmq {
host => ["${RABBITMQ_HOSTNAME}"]
exchange => "test"
exchange_type => "topic"
key => "test.#"
metadata_enabled => true
}
}

filter {
}

output {
stdout {
codec => rubydebug
}
http {
url => "http://${EVENTSTORE_HOSTNAME}:${EVENTSTORE_PORT}/streams/test"
http_method => "post"
content_type => "application/json"
follow_redirects => true
headers => { "ES-EventType" => "Test.Created" }
format => "message"
message => "{'data':'a'}"
}
}

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

The http library used is very conservative when it comes to status code handling. According to the RFC only HEAD and GET requests should be automatically redirected. Others like POST need user interaction (e.g. a browser dialog window).

The HTTP client does allow for having a custom redirect strategy to override this behaviour and even provides a more Lax strategy..aptly named LaxRedirectStrategy. Even this strategy won't redirect PUT requests, only HEAD/GET/DELETE/POST.

So at the moment there is no workaround other than using a GET request instead of a POST against the endpoint.