I have a number of queries in Log Analytics that share a few common parts that I have expressed in functions that I defined. There is a way to save them, but there is a problem invoking them from queries. Specifically, I can save and invoke a subquery, but I cannot save and invoke a scalar function.
For example, suppose I save the following query under name fiveEntries:
StormEvents
| limit 5
I can then invoke it as:
fiveEntries
Now I want to define a scalar function and save it under name value5:
let value5 = () {5};
I cannot invoke it by name and get an error:
StormEvents
| limit value5()
Syntax Error
Body of the callable expression cannot be empty
If issue persists, please open a support ticket.
Request id: 4b79daef-...
It looks like external user-defined scalar (and tabular) functions are not supported (and this seems to be confirmed by another writeup).
My questions:
Is this correct, or is there a way to get this to work?
If this is a real limitation, are there plans to add support for such functions (and when)?
Are there recommended ways of building and maintaining sets of common functions to be used across multiple Log Analytics queries?
Thanks in advance!