I have a grafana v10.2.2 dashboard time series panel and I'm struggling to customize the legend on it.
According to the docs, I could use templates like the following to customize the values shown, but instead I'm getting the booth results.
Expression used:
{{ if eq "1" "2" }} true {{ else }} false {{ end }}
My practical use case is to show a label value app if it is defined or the fixed value "Unknown" when it's absent.
I tried it with if and unless blocks, but none of the functions seemed to work, the function blocks are being ignored.
Thanks for any thoughts shared on it.

Let's try to implement real case:
My practical use case is to show a label value app if it is defined or the fixed value "Unknown" when it's absent.Let's transform it to:
applabel should have original app label value or ifapplabel doesn't exist thenapplabel should have valueUnknown.See linked doc:
So this is not Grafana feature (not Grafana's time series
Legendfield, which looks like you have used), but Loki query feature and it must be applied in the LogQL query.For example:
Example query may need some tweak (if there is any syntax issue, ...)
Of course real query depends on format of your real logs. Just see example how mentioned template can be used in
label_format. Just use then thatapplabel in Grafana's time seriesLegendfield (as{{app}}).