# Alert: full\_message is without linebreaks

**URL:** <https://community.graylog.org/t/alert-full-message-is-without-linebreaks/34485>\
**Category:** Graylog Central (peer support)\
**Tags:** alert\
**Created:** [December 19, 2024, 4:45pm UTC](https://community.graylog.org/t/alert-full-message-is-without-linebreaks/34485 "2024-12-19T16:45:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bjoern1234](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bjoern1234](https://community.graylog.org/u/Bjoern1234)\
**Post date:** [December 19, 2024, 4:45pm UTC](https://community.graylog.org/t/alert-full-message-is-without-linebreaks/34485/1 "2024-12-19T16:45:25Z")

</div>

**1. Describe your incident:**  
The full\_message like this:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/f/9/f9d9034cd948713522491ea9a0a202b59799fe7a.png)

is defined in Notification ‘Email HTML Body’ like this:

```auto
	<tr><td>Full Message</td><td></td></tr>
	<tr><td colspan="2">${message.fields.full_message}</td></tr>
	<tr><td colspan="2">------------------------------------------------------</td></tr>
	<tr><td></td><td></td></tr>

```

That results in following:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/e/1/e1300ff65c20efab311a4a6f0f56c4aa02a34a7a.png)

Why are there no linebreaks anymore?

**2. Describe your environment:**

- Graylog Open 6.1.2

**3. What steps have you already taken to try and solve the problem?**  
No idea how to fix that.

**4. How can the community help?**  
What to do, so that the full\_message is shown in the email notification with all the linebreaks?

---

<div class="post-metadata">

**Author:** ![Joel\_Duffield](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Joel\_Duffield](https://community.graylog.org/u/Joel_Duffield)\
**Post date:** [December 19, 2024, 5:17pm UTC](https://community.graylog.org/t/alert-full-message-is-without-linebreaks/34485/2 "2024-12-19T17:17:39Z")

</div>

If you look at the event in the all events stream on the search page how does that field look in there, does it have line breaks?

---

<div class="post-metadata">

**Author:** ![Bjoern1234](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bjoern1234](https://community.graylog.org/u/Bjoern1234)\
**Post date:** [December 23, 2024, 7:53am UTC](https://community.graylog.org/t/alert-full-message-is-without-linebreaks/34485/3 "2024-12-23T07:53:15Z")

</div>

> [@Bjoern1234](#):
>
> full\_message

The full\_message is well formatted on the search page (see the first screenshot of my request. So it seems that the linebreaks are removed during mapping into the Email HTML body.

---

<div class="post-metadata">

**Author:** ![Joel\_Duffield](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Joel\_Duffield](https://community.graylog.org/u/Joel_Duffield)\
**Post date:** [December 23, 2024, 12:45pm UTC](https://community.graylog.org/t/alert-full-message-is-without-linebreaks/34485/4 "2024-12-23T12:45:42Z")

</div>

So i dont mean the original message, when the event fires a new message is generated in the “all messages” stream, and all the custom fields your extract from the message are stored as a subfield. My guess is the loss of formstting occurs at that step, but i wanted to confirm.

---

<div class="post-metadata">

**Author:** ![Bjoern1234](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bjoern1234](https://community.graylog.org/u/Bjoern1234)\
**Post date:** [December 23, 2024, 1:21pm UTC](https://community.graylog.org/t/alert-full-message-is-without-linebreaks/34485/5 "2024-12-23T13:21:44Z")

</div>

So than that is a bug?  
Or can I use it somehow different to not lose the formatting?

---

<div class="post-metadata">

**Author:** ![Brendon\_Barnhart](https://avatars.discourse-cdn.com/v4/letter/b/b2d939/32.png) [@Brendon\_Barnhart](https://community.graylog.org/u/Brendon_Barnhart)\
**Post date:** [December 23, 2024, 3:46pm UTC](https://community.graylog.org/t/alert-full-message-is-without-linebreaks/34485/6 "2024-12-23T15:46:34Z")

</div>

The issue of missing line breaks in your email notification likely stems from how the HTML email template interprets the `full_message` field. When you use `${message.fields.full_message}`, the data is inserted as a single unformatted string, and the line breaks (e.g., `\n`) from the original log are ignored in the HTML rendering. HTML requires explicit tags for line breaks.

You can solve this by replacing the line breaks in the `full_message` field with HTML `<br>` tags before rendering the notification.

I was able to replicate the issue and the fix in a lab environment by using the following:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/3/e/3e705996e5f069da431b71b542612c82902c410a.png)

The `?replace("\n", "<br>")` in the template replaces newline characters (`\n`) in the `full_message` field with `<br>` tags, which are recognized by HTML as line breaks.This ensures that the message retains its original line-by-line format when rendered in the email body.

Let me know if this works for you. 🙂

---

<div class="post-metadata">

**Author:** ![Bjoern1234](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bjoern1234](https://community.graylog.org/u/Bjoern1234)\
**Post date:** [December 23, 2024, 5:12pm UTC](https://community.graylog.org/t/alert-full-message-is-without-linebreaks/34485/7 "2024-12-23T17:12:22Z")

</div>

Unfortunately not:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/3/8/387f0842e43085cc6c35c2fed35501586bd626d5.png)

---

<div class="post-metadata">

**Author:** ![Bjoern1234](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bjoern1234](https://community.graylog.org/u/Bjoern1234)\
**Post date:** [December 30, 2024, 8:45am UTC](https://community.graylog.org/t/alert-full-message-is-without-linebreaks/34485/8 "2024-12-30T08:45:56Z")

</div>

Is there a way to solve that problem with the missing line breaks?  
Do I use the function in a wrong way?

---

<div class="post-metadata">

**Author:** ![Bjoern1234](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bjoern1234](https://community.graylog.org/u/Bjoern1234)\
**Post date:** [January 6, 2025, 12:56pm UTC](https://community.graylog.org/t/alert-full-message-is-without-linebreaks/34485/9 "2025-01-06T12:56:35Z")

</div>

I wish everybody happy New Year.  
Who can help me with this described issue?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [January 20, 2025, 12:57pm UTC](https://community.graylog.org/t/alert-full-message-is-without-linebreaks/34485/10 "2025-01-20T12:57:21Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
