-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hi!
I'm trying to use webhook to send alerts to Telegram. So my body should look like this:
{
"chat_id": "123456",
"text": "alert content"
}
And I would like to send the value of Source.Results using repetition syntax as I've found in https://github.com/serilog/serilog-expressions?tab=readme-ov-file#repetition
{ {
chat_id: '123456',
text: {#each k, v in @p['Source']['Results']}{k} = {v}{#delimit},{#end}
} }
But the template above gives me error
System.ArgumentException: Syntax error (line 3, column 8): unexpected #.
At the same time if I use it like this
{ {
chat_id: '123456',
text: @p['Source']['Results']
} }
it is ok, but this gives me unformatted array value. And I would like to concat formatted array output like this:
text: concat(@p['Alert']['Title'], '\n', {#each k, v in @p['Source']['Results']}{k} = {v}{#delimit},{#end})
Thanks in advance!
Metadata
Metadata
Assignees
Labels
No labels