Formatting markdown alert email (new line)

Hi,
In "Rules and Connectors", I created an alert generating an email.
In this email, I want to display values of a fields, that contain NewLines
In Discover, we can see these NewLines.
In the email, there is no more NewLines.
Even though we use markdown, is there a way to display the value of this field, while respecting the NewLines in this value?
Thank you.
(I use Kibana 7.17)

1 Like

Hi,
I found a solution because the values with new lines come from a SQL query.
Then I modified the query like this :

  • original :
select  Message  'ErrMsg_Message',   (...)
  • after:
select  REPLACE(Message, CHAR(13) + CHAR(10), '  ' + CHAR(13) + CHAR(10))   'ErrMsg_Message'  (...)

As the DB server is under Windows, the End-of-line is CHAR(13) + CHAR(10) (hexa: 0D 0A).
It inserts two spaces before the EOL, so that markdown prints a new line.

I had also a similar problem with the date, to make it more readable. For example :
2023-04-27T13:36:32.364Z --> 27/04/2023 13:36:32
with :

select   FORMAT(Date,'dd/MM/yyyy HH:mm:ss '),

But to display the Kibana @timestamp (in the alert mail : {{context.date}}), I don't know.
Hope it helps....

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