logstash-plugins / logstash-filter-http

HTTP Filter Plugin for Logstash
Apache License 2.0
12 stars 29 forks source link

Friendlier handling of non 200 response codes #30

Open jsvd opened 3 years ago

jsvd commented 3 years ago

Currently anything that's not a 200 means the plugin won't process headers or the body. In many cases this isn't ideal as these are still valuable for debugging / observability purposes.

A way to improve this would be to always process the body and headers, but only apply the filter_matched method on successful requests (200 status code)

emilymcalister commented 2 years ago

Linking new issue - did not see this when raising: https://github.com/elastic/logstash/issues/14368

C0rn3j commented 8 months ago

There is no way to show body value, not even TRACE debug level shows it, this caused me a lot of frustration and ending up having to set up netcat listener just to see what was going wrong as my endpoint does not necessarily support easy access to raw data.

Status code nor response body nor response headers are saved on error, which is very frustrating.

It would be nice to be able to optionally save the request body too.

My reponse body contains a JSON with details when an error occurs, with this plugin there is no way to use them much less parse them.

Whatever behavior is decided should be communicated on the documentation, currently it doesn't mention it, nor that it throws a _httprequestfailure tag.

https://www.elastic.co/guide/en/logstash/current/plugins-filters-http.html