Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json decoder should raise error when input is invalid #11

Closed
vqng opened this issue Jun 25, 2015 · 3 comments
Closed

json decoder should raise error when input is invalid #11

vqng opened this issue Jun 25, 2015 · 3 comments

Comments

@vqng
Copy link

vqng commented Jun 25, 2015

sample log that is not valid json

1434701105.727    86 127.0.0.1 TCP_MISS/204 316 GET http://b.scorecardresearch.com/b? - HIER_DIRECT/184.51.147.121 -
1434701105.728    34 127.0.0.1 TCP_MISS/200 3929 GET http://assetscdn.paytm.com/images/catalog/product/C/CM/CMPLXDMG_MMXA94WHTWTEARMSCR_NULL_NULL/210x210/2.jpeg - HIER_DIRECT/157.238.74.178 image/jpeg

The json decoding process should fail but it doesn't.
This issue was originally raised at elastic/logstash-forwarder#293 (comment)

@driskell
Copy link

Seems the JSON decoder actually succeeds and returns a float containing "1434701105.727". Because this is not a Hash it causes an exception when Logstash tries to create a new event for it.

The decoder should probably check the result is a Hash and raise a parse error if not.

@jlintz
Copy link

jlintz commented Jun 30, 2015

We've seen this as well since upgrading to 1.5 where normally we were able to set the codec to JSON on the lumberjack input and it would fail back fine to plaintext , it's now crashing on certain inputs, haven't been able to grab which lines are causing the issue yet

@andrewvc
Copy link
Contributor

@jlintz @driskell this should be fixed in the latest release of this plugin 1.1.0. Try upgrading and see if that helps you out :)

Please reopen this ticket if you have any further issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants