Open mortifactor opened 2 months ago
Hi @mortifactor ,
I think the array formatted string might be the best you can get here. The docs note that:
Template directives like {#if} only work in the outermost template - they can't be used as expressions nested inside holes or objects. In an expression, Seq's regular if construct can be used.
I believe you are running into that limitation.
Ah, I see. My apologies! I guess I'd missed it because I was searching in Serilog docs.
If I understand it's not possible to put concat array string (even unformatted) with other string?
E.g. text: concat(@p['Alert']['Title'], @p['Source']['Results'])
@mortifactor - that looks ok. The docs say you can't use template directives (#if, #each) but template expressions should be ok. @p
should be @Properties
.
Hi!
I'm trying to use webhook to send alerts to Telegram. So my body should look like this:
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
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
it is ok, but this gives me unformatted array value. And I would like to concat formatted array output like this:
Thanks in advance!