Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use variable with Array in Application Insights

I would like to use a variable which contains an array, so I can use it with in filter.

this works:

traces
| where cloud_RoleName in ("A", "B")

this does not work (syntax error):

let cloudRoleNames = ("A", "B");
traces
| where cloud_RoleName in cloudRoleNames

I would like to use the array as variable to be able to use the same filter in more joins at once. As a workaround I use the first working variant but it is not ideal. I tried various ways - as well via parsing json but nothing works. Am I missing something obvious? Thx

like image 358
Lukas K Avatar asked Sep 08 '26 02:09

Lukas K


1 Answers

Try this instead:

let cloudRoleNames = dynamic(["A", "B"]);
traces
| where cloud_RoleName in (cloudRoleNames)

Relevant docs:

  • in operator
  • the dynamic data type
like image 115
Yoni L. Avatar answered Sep 11 '26 13:09

Yoni L.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!