Score:0

Azure Log Analytics function parameter

co flag

In an Azure Log Analytics workspace, I'm seeking to create an LA function with a single parameter, that parameter being the tablename of a remote workspace, via the workspace() KQL function.

I've tried making a function called MyTestFunc with 1 parameter passed as type 'string' with a name of TableName, and the following KQL:

workspace('my_remote_workspace').TableName

Calling this function as MyTestFunc("Usage") errors with:

Failed to resolve entity 'TableName'

Calling this function as MyTestFunc(Usage) errors with:

MyTestFunc(): argument #1 must be a scalar expression

I've tried passing the parameter, like this:

workspace('my_workspace').tablevar

Also, errors. I suspect the variable (or parameter-name) being stuck against the '.' causes it not to resolve, but I haven't yet found a workaround.

I want a single function I can create, and pass tablenames to the function as a parameter, and have relevant data returned.

Any thoughts? Looks deceptively simple, but has turned out to be tricky.

Thanks.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.