I am having difficult time making logstash http output plugin to forward events to http endpoint which returns 307. (no control over that). Redirect needs to be followed to get to the right URL.
I'm not a ruby dev, so it is hard for me to investigate, but I don't see how this option is passed to http client from Logstash http plugin. It seems only URL, method, body and headers are passed.
Or is it implicitly available via some scope ruby magic?
Unless I'm mistaken the class in the file I linked to is basically merged with the http output plugin class so everything in the mixin class is also available in the plugin.
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.