logstash-input-http icon indicating copy to clipboard operation
logstash-input-http copied to clipboard

option to reject malformed requests

Open jpcarey opened this issue 6 years ago • 3 comments

If the http input has codec => json set, and the request does not contain valid json - there should be an option to enable rejecting this message rather than just accepting it and returning a 200 OK (current behavior).

jpcarey avatar Jun 28 '18 20:06 jpcarey

Hello did this ever get added to the input plugin? I could really use this functionality for error checking and tests. Thanks!

devinbfergy avatar May 20 '19 18:05 devinbfergy

I was expecting that a malformed-JSON input would have returned a non-200 code as well, so it was a bit of a surprise to see them returning 200s. I do see that I can suppress a return code, but I'd prefer to outright reject it without having to add a filter drop or a null output.

While not a plugin issue, the JSON codec will throw errors for everyone of these.

[2020-02-24T22:29:27,692][ERROR][logstash.codecs.json ][main] JSON parse error, original data now in message field {:error=>#<LogStash::Json::ParserError: Unrecognized token 'xxxxxxxxxxxxxxxx': was expecting ('true', 'false' or 'null')

dorth avatar Feb 24 '20 23:02 dorth

Are there plans to fix this?

mlucool avatar Nov 04 '20 18:11 mlucool