Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doing where condition with an array of value in KQL

I'm trying so simplify my searches since I'm searching same values in different tables, I want to put the searched values in a table and put it in my where condition can't succeed to do it, I tried with "has_any" operator or "in", I tried several types of variable, can someone help on that :

let array= ("AAA","BBB","CCC");

Table
|where Field in(array)

Table1
|where Field1 in (array)

Thank you

like image 927
An0n Avatar asked Oct 17 '25 09:10

An0n


1 Answers

I had a similar requirement and ended up using the dynamic data type. This will work:

let array = dynamic(["AAA", "BBB", "CCC"]);

Table
|where Field in(array)

The reason you need to use the dynamic data type in the context of your query is that the in operator in Kusto Query Language (KQL) expects the right-hand side to be a dynamic array.

like image 188
DataBach Avatar answered Oct 20 '25 12:10

DataBach