1
votes

I am pretty new to Azure Data Explorer (Kusto) queries. I have a stored function, that takes a dateTime as a parameter, does some querying around that dateTime and return a data table.

MyStoredFunction(timestamp:datetime){
 // some query 
}

For several limitations I have to run this function several times, with consecutive datetimes with a one-hour interval between each, then unite the result as a single table using the union operator.

ResultTable
| union MyStoredFunction(now(-1h))
, MyStoredFunction(now(-2h))
, MyStoredFunction(now(-3h))
, MyStoredFunction(now(-4h))
, MyStoredFunction(now(-5h))
, MyStoredFunction(now(-6h))
| Project column1, column2, column3
| Summarize …

Is there a way to beatify the above ugly query using the range operator or any other Kusto query operators?

Something like this (the bellow query is not valid, it's just for illustration):

range TIMESTAMP from now(-7h) to now() step 1h
| ResultTable = union ResultTable, MyStoredFunction(TIMESTAMP)

Any help is much appreciated.

1

1 Answers

0
votes

Currently this is not possible.

The union operator supports wildcards, but only for actual tables and not results of function executions.