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

Character limit for json_lines #109

Closed
clarkent86 opened this issue Dec 20, 2016 · 10 comments
Closed

Character limit for json_lines #109

clarkent86 opened this issue Dec 20, 2016 · 10 comments

Comments

@clarkent86
Copy link

I seem to be experiencing an issue with my rails app where I'm trying to log a large event and the json_lines codec seems to malfunction. When the event occurs successfully a lot of data is logged, but the log is sent to my catch all index instead of logging it under the name of the controller because instead of being parsed by json_lines it's all being dumped into the message field. When there is an issue with the application and not much is logged besides the failure, json_lines works fine.

@dwbutler
Copy link
Owner

Hi, thanks for the bug report.

I'll need to know more information to continue debugging this issue. Things like:

  • What is your full LogStashLogger configuration?
  • What is your logstash listener configuration?
  • What are you writing to? TCP? Elasticsearch?
  • How are you writing the log message to LogStashLogger? Are you using any extra gems?

@dwbutler dwbutler added the bug label Dec 20, 2016
@clarkent86
Copy link
Author

I was pretty sure there was some sort of character limitation but as I've been working through my issue I've found it to be with the actual JSON format that was being parsed. I could only recreate it some of the time with the same test data; frankly it still doesn't make sense to me why it worked some of the time. Anyways I think I'm on the correct path to fixing my issue, sorry for the false alarm!

@dwbutler
Copy link
Owner

That would make sense. If you try to log a JSON string to LogStashLogger, and it cannot parse it, it will dump the contents into the message field (which is consistent with your observation).

@dwbutler dwbutler removed the bug label Dec 21, 2016
@clarkent86
Copy link
Author

clarkent86 commented Dec 21, 2016 via email

@dwbutler
Copy link
Owner

What logstash listener configuration are you using? It would be good to know the details of your issue so it can be documented in the Troubleshooting section of the readme.

@clarkent86
Copy link
Author

I'm using logstash version 2.3.2. What other information would you want for documentation?

@dwbutler
Copy link
Owner

Basically the contents of the config file that you use with logstash. Or at least which output you're using so I can figure out where to look in the logstash source code.

@clarkent86
Copy link
Author

clarkent86 commented Dec 29, 2016 via email

@dwbutler
Copy link
Owner

I think you're experiencing the same issue reported in #43. To the best of my knowledge, this is a bug in Logstash's implementation of the UDP input.

Is there a reason you're sending the events to a UDP listener first and then forwarding to Redis? Why not send the events directly from LogstashLogger to Redis?

@dwbutler
Copy link
Owner

You mentioned something that sounds important - the final { at the end of the message was not preceded by a newline. This is unexpected. This means that the newline character is being stripped at some point in the process.

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

2 participants