-
Notifications
You must be signed in to change notification settings - Fork 24
Adding custom functions
Neil MacMullen edited this page Dec 13, 2025
·
4 revisions
See the CustomFunctions sample
Create a partial function annotated with KustoImplementation
// ReSharper disable PartialTypeWithSinglePart
[KustoImplementation(Keyword = "fizz")]
public partial class FizzFunction
{
}
Add a dependency to SourceGeneration
<ProjectReference Include="..\SourceGeneration\SourceGeneration.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
Add nuget refs to Kusto Language and KustoLoco.Core
Add one or more "Impl" methods inside the Function class
public static string Impl(long n)
{
var fizz = n % 3 == 0 ? "fizz" : string.Empty;
var buzz = n % 5 == 0 ? "buzz" : string.Empty;
return fizz + buzz;
}
IMPORTANT method names must end "Impl". If more than overide is provided, a unique prefix for each method-name is required.
Null-checking for parameters is not required; the default behaviour for the source generator is to automatically return null/string.Empty if any parameter is null.
#Home
Core Engine
Lokqldx (UI data explorer)
- Introduction
- Tutorials
- Running queries and commands
- Autocompletion
- Generating powerpoint reports
- Accessing ApplicationInsights data
Powershell
Other
Articles