Forum Discussion
kart4u
Microsoft
Mar 06, 2019Parameterized functions to use for calculating and output the flag
I am trying to write a function that returns whether it is working hour or not based on the timestamp. It goes like this
let IsWorkingHours = (timestamp:datetime)
{
let hour = hourofday(timestamp));
case( hour > 8 and hour < 18, 1, 0)
};
I was able to save the function but not able to reference it (getting bad gateway - error retrieving data). Is this even supported ? What are the alternatives ?
2 Replies
Functions in Log Analytics expect direct output. So first your function should output something so when it is called it can be executed. Also as mentioned by Vino55 parameterization is not possible.
- Vino55
Microsoft
I don't think parameterized function is supported as of now.
You can however create non-parameterized function, save it and then reference it.