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

Render leading whitespace in log messages #140

Closed
dbsanfte opened this issue Jun 29, 2017 · 7 comments
Closed

Render leading whitespace in log messages #140

dbsanfte opened this issue Jun 29, 2017 · 7 comments
Labels

Comments

@dbsanfte
Copy link

dbsanfte commented Jun 29, 2017

We have a lot of log messages that are indented as part of "prettifying" JSONs. These show up fine in Kibana, so the leading whitespace is there, but Logtrail strips it out when it renders it in the browser. This makes our logs a lot less pretty (the JSONs are flat and ugly).

Can we have some sort of option for Logtrail to render the leading whitespace in our log messages?

Cheers :)

@dbsanfte dbsanfte changed the title Preserve leading/trailing whitespace in log messages Render leading/trailing whitespace in log messages Jun 29, 2017
@dbsanfte dbsanfte changed the title Render leading/trailing whitespace in log messages Render leading whitespace in log messages Jun 29, 2017
@sivasamyk
Copy link
Owner

Can you please share a screenshot of the logtrail and a sample ES document ? Make sure you hide confidential info.

@dbsanfte
Copy link
Author

Original logs as viewed in Kibana (out of order):
http://imgur.com/a/OiWOS

Renders like (in order but all indentation scrubbed):
http://imgur.com/a/UTfUe

@sivasamyk
Copy link
Owner

@dbsanfte I see that each line in the json object is interpreted as an event. I would recommend you to use logstash to format the event and map the whole json doc to a field in event or extract multiple fields from json.

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

@dbsanfte
Copy link
Author

dbsanfte commented Jul 3, 2017

I had a dig into your suggested solution, but no dice. The main problem is that multiline-gelf isn't supported in Logstash. The multiline codec doesn't work with gelf, and the multiline filter was deprecated in logtash versions 5.x.

logstash-plugins/logstash-input-gelf#37

In the meantime is there any way to get Logtrail to honour the leading whitespace?

@dbsanfte
Copy link
Author

dbsanfte commented Jul 4, 2017

Actually nevermind. I was able to edit the css to 'white-space: pre', but some messages are out of order and the JSONs aren't rendered right.

I guess I'll need to wait for multiline gelf support in Logstash. Thanks for the response. :)

@sivasamyk
Copy link
Owner

Great. I was about test similar changes before proposing!

@sivasamyk
Copy link
Owner

Added white-space: pre-word in CSS for message

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

No branches or pull requests

2 participants