Blog Post

Azure Data Explorer Blog
1 MIN READ

How to create the output schema from Kusto query

ShafMahmood's avatar
ShafMahmood
Icon for Microsoft rankMicrosoft
Aug 01, 2022

If you are using Kusto plugins that require an output schema definition as part of its syntax then it can be tricky to put together.

 

The sql_request plug in for example is one plugin that requires this.

 

Example: sql_request() : (ID:guid, Name:string, LocationLat:real, LocationLong:real)

 

The getschema operator currently is one method to get the information but it is shown in tabular format (as shown below) and still requires you to construct the syntax.

 

 

The good news is that the getschema operator has been updated to allow you to specify the output to be shown in an easy and reusable format.  You can do this by adding a parameter of kind=csl to the operator as shown in the example below.

 

 

You can simply copy and paste the output and include it in the syntax for your plugin.

 

Published Aug 01, 2022
Version 1.0

2 Comments

  • VAISE280's avatar
    VAISE280
    Copper Contributor

    Using Python plugin, some times would be great to decide the schema within the script and not beforehand.

    Is there any way to parse a string with the schema?