Anders Sewerin Johansen
Anders Sewerin Johansen

Reputation: 1656

Can I use tabular parameters in Kusto user-defined functions

Basically I'd like to pass in a set of field values to a function so I can use in/!in operators. I'd prefer to be able to use the result of a previous query rather than having to construct a set manually.

As in:

let today = exception | where EventInfo_Time > ago(1d) | project exceptionMessage;
MyAnalyzeFunction(today)

What is then the signature of MyAnalyzeFunction?

Upvotes: 1

Views: 6443

Answers (1)

Yoni L.
Yoni L.

Reputation: 25895

See: https://learn.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions

For instance, the following will return a table with a single column (y) with the values 2 and 3:

let someTable = range x from 2 to 10 step 1
;
let F = (T:(x:long)) 
{
    range y from 1 to 3 step 1
    | where y in (T)
}
;
F(someTable)

Upvotes: 7

Related Questions