Graylog2 / Graylog2/graylog2-server

carriage return \r, not considered in message field

Open
#4,470 0 comments 2 reactions 0 assignees View on GitHub
bug papercut triaged widgets
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

## Expected Behavior, _similar to Graylog Web Interface 2.3_
When a message contains carriage returns, with css attribute: `white-space=pre-wrap` the browser should consider it and render accordingly, by using a new line in place. And this is the case for graylog web interface version 2.3

## Current Behavior, _Graylog Web Interface 2.4_
Even with `white-space=pre-wrap`, the text is not displayed correctly. Carriage return is "considered as white space" rather than new line, so all the stack-traces are one line of java classes.

## Possible Solution
1. changing `div` to `textarea`, worked just fine since it considers well the `pre-wrap`
- this one looks like viable solution, though not sure
2. replacing all `\r` with `\n` within the `MessageShow.possiblyHighlight` on the result of `stringify()`, worked as well
- does not seems like something nice to do, still, it's a finding

## Steps to Reproduce (for bugs)
1. have graylog 2.4 up and running
2. push a log with `\r`
3. check that the word just after `\r` is not on the next line

## Context
We are collecting data from docker logs via `gelf driver` and it works as expected.

## Your Environment

* Graylog Version: 2.4.0+2115a42
* Elasticsearch Version: 5.6.5 6a37571
* MongoDB Version: v3.2.11
* Operating System: Ubuntu 17.10, 16.04
* Browser version: Firefox 57.0.4, Chrome 63

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.