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