Inconsistent newlines in email body text

I'm using this Watcher code to send myself emails:

"body": {
  "text": "{{#ctx.payload.hits.hits}}{{_source.@timestamp}} {{_source.message}}\n{{/ctx.payload.hits.hits}}"

But I don't get a newline in the email body between hits. But when I add some extra characters around the newline like this:

    "body": {
      "text": "{{#ctx.payload.hits.hits}}{{_source.@timestamp}} {{_source.message}} *\n* {{/ctx.payload.hits.hits}}"

The newline magically appears between the asterisks. This is the latest ELK stack with Kibana 6.4.

Why is this inconsistent? I just want a simple list of my hits in the email body.

Thanks

Hey

I suppose you are hitting this one: https://github.com/elastic/elasticsearch/issues/26882

--Alex

Thanks. I just switched to HTML and that seems to get me what I want.

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