As a follow up… do you know if it’s possible to declare and use variables in grail queries? Similar to using the let statement in kusto queries.
For example, something like this psuedo-code:
// declare a variable
let p = "my_alerting_profile_name"
fetch events, from:now()-30d, to:now()
... omitted for brevity
| filter matchesValue(profile, $p) // <-- use the variable here