Passing column name as parameter in Kusto query

Viewed 1482

I need to pass the column name dynamically into the query. While following is syntactically correct it does not really execute the condition on the particular column.

Is this even possible in Kusto?

let foo = (duration: timespan, column:string) {
    SigninLogs
    | where TimeGenerated >= ago(duration) 
    | summarize totalPerCol = count() by ['column']
};
//foo('requests')<-- does not work
//foo('user') <-- does not work
//foo('ip')<-- does not work
1 Answers
Related