Is there any if/else syntax when using variable

usage:

if $app == all {
 prom_bucket{}
} else {
 prom_bucket{app=$app}
}

Why you don’t customize All value for app variable. g. .*

Then use regexp for app selector app=~"$app"