Get Hands-On KQL Practice with this Microsoft Sentinel Workbook

Published Jan 11 2022 10:01 AM 7,365 Views
Microsoft

Thank you to @Steve Faehl@Jing Nghik, and @Sreedhar_Ande  for co-authoring this solution. Thank you as well to the many Microsoft employees who assisted with testing this workbook and by providing feedback for change.

 

Looking to start the new year with KQL? Looking for a hands-on method to do so? Look no further with this interactive KQL learning workbook in Microsoft Sentinel!

 

The Kusto Query Language (KQL) is the driving language for using Microsoft Sentinel. Though similar to SQL, new users must still learn and practice the language. To assist in accelerating learning the language, an interactive learning workbook has been created. This current version will assist new or existing users gain a 100-200 level understanding of the language while also providing hands-on experience that will assist them with hitting the ground running when executing real world queries. 

 

This workbook is made up of several parts:

  • Demo data - Sample data is provided so that users who may not have data in their environments can still use the workbook to learn.
  • Documentation - Direct links to guides, official documents, and other documents detailing KQL.
  • Tabs - Categorized tabs that group operators together based on action.
  • Exercises - Handwritten exercises that are meant to challenge the user and get them to practice the operator that they just learned. For some operators, the complexity goes up when attempting more exercises.
  • Query space - Section that allows the user to write KQL that will be run against the demo data. Though the space does not include intellisense, it still simulates what a user would use when performing a query.
  • Expected answer - Results that the user should see when they are done running their query.
  • Your answer - Results returned from the query that was entered in the query space.
  • Checker - Function that checks to make sure that the results expected are the same as the results that the user got.

Workflow:

When a user enters the workbook, they will need to choose a tab that houses the operators that can be practiced. Once a tab is selected, the operators will be listed with the related exercises and content. 

 

Entry.gif

 

Once the exercise is selected, the user can reference the documentation or a summary of the operator. The summary includes examples and when to use the operator in a query. 

 

Once a user feels ready to practice the operator, they can go to the query space and attempt the exercise. As the user types, the query will be performed against the data and results will be returned. If the answer is correct, the user can attempt another exercise for the operator (if there is one provided) or they can move onto another operator. If the answer is incorrect, the user can attempt the exercise again or reveal the answer to learn more.

Exercise.gif

 

This process is repeated throughout the workbook. Once the user completes the workbook, they should have a level 200 understanding of KQL and how to use it in a query. To supplement this workbook, the Advanced KQL Framework workbook is linked as well as the Azure Log Analytics demo workspace. The Advanced KQL workbook will provide users more examples and detailed use cases to continue their learning. The Azure Log Analytics demo workspace will allow users to practice what they have learned on more real data that is similar to what they see in their workspaces.

Note: The Advanced KQL Framework workbook will need to be deployed in the environment for the button to open the tab to work.Note: The Advanced KQL Framework workbook will need to be deployed in the environment for the button to open the tab to work.

 

Deployment:

 

In the event that the workbook is not available yet in the workbooks gallery, the workbook can be deployed via the following process:

  • Find the workbook in the GitHub repository.
  • Copy the JSON of the workbook.
  • Go to Microsoft Sentinel.
  • Go to Workbooks.
  • Click 'add workbook'.
  • Go into edit mode and enter the advanced editor.
  • Paste the copied content and click apply.

Deployment.gif

 

Things to Note:

  • Upon deployment, there may be an issue where the data being pulled in will need to be authorized. To do so:
    • Within the workbook, go into edit mode.
    • Go to the hidden parameters at the top.
    • Click edit under and to the right of the parameters. 
    • Click on JSON and click the pencil icon.
    • Click run query in the window.
    • An error message will appear saying that the content must be trusted, click the 'add as trusted' button that appears.
    • Save the setting and the workbook.
  • There are certain operators that cannot be checked, this may result in error. This applies to exercises that use extend, let, or externaldata.
  • This is the first release of the workbook. In future releases there will be more content, more exercises, and methods to upload custom exercises that allows users to pick and choose use cases that can help with job specific use cases.
  • The demo data provided is hosted within the public Microsoft Sentinel GitHub repository.

Go out and practice KQL today! If there are operators or exercises that you feel should be added to the workbook, please consider submitting feedback via our form.

%3CLINGO-SUB%20id%3D%22lingo-sub-3055600%22%20slang%3D%22en-US%22%3EGet%20Hands-On%20KQL%20Practice%20with%20this%20Microsoft%20Sentinel%20Workbook%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3055600%22%20slang%3D%22en-US%22%3E%3CP%3E%3CEM%3E%3CFONT%20size%3D%222%22%3EThank%20you%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F90293%22%20target%3D%22_blank%22%3E%40Steve%20Faehl%3C%2FA%3E%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F113212%22%20target%3D%22_blank%22%3E%40Jing%20Nghik%3C%2FA%3E%2C%20and%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F773864%22%20target%3D%22_blank%22%3E%40Sreedhar_Ande%3C%2FA%3E%26nbsp%3B%26nbsp%3Bfor%20co-authoring%20this%20solution.%20Thank%20you%20as%20well%20to%20the%20many%20Microsoft%20employees%20who%20assisted%20with%20testing%20this%20workbook%20and%20by%20providing%20feedback%20for%20change.%3C%2FFONT%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELooking%20to%20start%20the%20new%20year%20with%20KQL%3F%20Looking%20for%20a%20hands-on%20method%20to%20do%20so%3F%20Look%20no%20further%20with%20this%20interactive%20KQL%20learning%20workbook%20in%20Microsoft%20Sentinel!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20Kusto%20Query%20Language%20(KQL)%20is%20the%20driving%20language%20for%20using%20Microsoft%20Sentinel.%20Though%20similar%20to%20SQL%2C%20new%20users%20must%20still%20learn%20and%20practice%20the%20language.%20To%20assist%20in%20accelerating%20learning%20the%20language%2C%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FWorkbooks%2FIntrotoKQL.json%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Ean%20interactive%20learning%20workbook%3C%2FA%3E%20has%20been%20created.%20This%20current%20version%20will%20assist%20new%20or%20existing%20users%20gain%20a%20100-200%20level%20understanding%20of%20the%20language%20while%20also%20providing%20hands-on%20experience%20that%20will%20assist%20them%20with%20hitting%20the%20ground%20running%20when%20executing%20real%20world%20queries.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20workbook%20is%20made%20up%20of%20several%20parts%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EDemo%20data%20-%20Sample%20data%20is%20provided%20so%20that%20users%20who%20may%20not%20have%20data%20in%20their%20environments%20can%20still%20use%20the%20workbook%20to%20learn.%3C%2FLI%3E%0A%3CLI%3EDocumentation%20-%20Direct%20links%20to%20guides%2C%20official%20documents%2C%20and%20other%20documents%20detailing%20KQL.%3C%2FLI%3E%0A%3CLI%3ETabs%20-%20Categorized%20tabs%20that%20group%20operators%20together%20based%20on%20action.%3C%2FLI%3E%0A%3CLI%3EExercises%20-%20Handwritten%20exercises%20that%20are%20meant%20to%20challenge%20the%20user%20and%20get%20them%20to%20practice%20the%20operator%20that%20they%20just%20learned.%20For%20some%20operators%2C%20the%20complexity%20goes%20up%20when%20attempting%20more%20exercises.%3C%2FLI%3E%0A%3CLI%3EQuery%20space%20-%20Section%20that%20allows%20the%20user%20to%20write%20KQL%20that%20will%20be%20run%20against%20the%20demo%20data.%20Though%20the%20space%20does%20not%20include%20intellisense%2C%20it%20still%20simulates%20what%20a%20user%20would%20use%20when%20performing%20a%20query.%3C%2FLI%3E%0A%3CLI%3EExpected%20answer%20-%20Results%20that%20the%20user%20should%20see%20when%20they%20are%20done%20running%20their%20query.%3C%2FLI%3E%0A%3CLI%3EYour%20answer%20-%20Results%20returned%20from%20the%20query%20that%20was%20entered%20in%20the%20query%20space.%3C%2FLI%3E%0A%3CLI%3EChecker%20-%20Function%20that%20checks%20to%20make%20sure%20that%20the%20results%20expected%20are%20the%20same%20as%20the%20results%20that%20the%20user%20got.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSTRONG%3EWorkflow%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EWhen%20a%20user%20enters%20the%20workbook%2C%20they%20will%20need%20to%20choose%20a%20tab%20that%20houses%20the%20operators%20that%20can%20be%20practiced.%20Once%20a%20tab%20is%20selected%2C%20the%20operators%20will%20be%20listed%20with%20the%20related%20exercises%20and%20content.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Entry.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F338242i1DE8671E22BD4DED%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Entry.gif%22%20alt%3D%22Entry.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20the%20exercise%20is%20selected%2C%20the%20user%20can%20reference%20the%20documentation%20or%20a%20summary%20of%20the%20operator.%20The%20summary%20includes%20examples%20and%20when%20to%20use%20the%20operator%20in%20a%20query.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20a%20user%20feels%20ready%20to%20practice%20the%20operator%2C%20they%20can%20go%20to%20the%20query%20space%20and%20attempt%20the%20exercise.%20As%20the%20user%20types%2C%20the%20query%20will%20be%20performed%20against%20the%20data%20and%20results%20will%20be%20returned.%20If%20the%20answer%20is%20correct%2C%20the%20user%20can%20attempt%20another%20exercise%20for%20the%20operator%20(if%20there%20is%20one%20provided)%20or%20they%20can%20move%20onto%20another%20operator.%20If%20the%20answer%20is%20incorrect%2C%20the%20user%20can%20attempt%20the%20exercise%20again%20or%20reveal%20the%20answer%20to%20learn%20more.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Exercise.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F338243i1AF9FC7ADDAB2771%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Exercise.gif%22%20alt%3D%22Exercise.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20process%20is%20repeated%20throughout%20the%20workbook.%20Once%20the%20user%20completes%20the%20workbook%2C%20they%20should%20have%20a%20level%20200%20understanding%20of%20KQL%20and%20how%20to%20use%20it%20in%20a%20query.%20To%20supplement%20this%20workbook%2C%20the%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fmicrosoft-sentinel-blog%2Fadvanced-kql-framework-workbook-empowering-you-to-become-kql%2Fba-p%2F3033766%22%20target%3D%22_self%22%3EAdvanced%20KQL%20Framework%3C%2FA%3E%20workbook%20is%20linked%20as%20well%20as%20the%20A%3CA%20href%3D%22https%3A%2F%2Faka.ms%2Flademo%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Ezure%20Log%20Analytics%20demo%20workspace%3C%2FA%3E.%20The%20Advanced%20KQL%20workbook%20will%20provide%20users%20more%20examples%20and%20detailed%20use%20cases%20to%20continue%20their%20learning.%20The%20Azure%20Log%20Analytics%20demo%20workspace%20will%20allow%20users%20to%20practice%20what%20they%20have%20learned%20on%20more%20real%20data%20that%20is%20similar%20to%20what%20they%20see%20in%20their%20workspaces.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Note%3A%20The%20Advanced%20KQL%20Framework%20workbook%20will%20need%20to%20be%20deployed%20in%20the%20environment%20for%20the%20button%20to%20open%20the%20tab%20to%20work.%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F338251i583F5A525C7FC51C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Extra.gif%22%20alt%3D%22Note%3A%20The%20Advanced%20KQL%20Framework%20workbook%20will%20need%20to%20be%20deployed%20in%20the%20environment%20for%20the%20button%20to%20open%20the%20tab%20to%20work.%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ENote%3A%20The%20Advanced%20KQL%20Framework%20workbook%20will%20need%20to%20be%20deployed%20in%20the%20environment%20for%20the%20button%20to%20open%20the%20tab%20to%20work.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EDeployment%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20event%20that%20the%20workbook%20is%20not%20available%20yet%20in%20the%20workbooks%20gallery%2C%20the%20workbook%20can%20be%20deployed%20via%20the%20following%20process%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EFind%20the%20workbook%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FWorkbooks%2FIntrotoKQL.json%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EGitHub%20repository%3C%2FA%3E.%3C%2FLI%3E%0A%3CLI%3ECopy%20the%20JSON%20of%20the%20workbook.%3C%2FLI%3E%0A%3CLI%3EGo%20to%20Microsoft%20Sentinel.%3C%2FLI%3E%0A%3CLI%3EGo%20to%20Workbooks.%3C%2FLI%3E%0A%3CLI%3EClick%20'add%20workbook'.%3C%2FLI%3E%0A%3CLI%3EGo%20into%20edit%20mode%20and%20enter%20the%20advanced%20editor.%3C%2FLI%3E%0A%3CLI%3EPaste%20the%20copied%20content%20and%20click%20apply.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Deployment.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F338250iD61B16BCDF1DFD08%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Deployment.gif%22%20alt%3D%22Deployment.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EThings%20to%20Note%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EUpon%20deployment%2C%20there%20may%20be%20an%20issue%20where%20the%20data%20being%20pulled%20in%20will%20need%20to%20be%20authorized.%20To%20do%20so%3A%3CUL%3E%0A%3CLI%3EWithin%20the%20workbook%2C%20go%20into%20edit%20mode.%3C%2FLI%3E%0A%3CLI%3EGo%20to%20the%20hidden%20parameters%20at%20the%20top.%3C%2FLI%3E%0A%3CLI%3EClick%20edit%20under%20and%20to%20the%20right%20of%20the%20parameters.%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3EClick%20on%20JSON%20and%20click%20the%20pencil%20icon.%3C%2FLI%3E%0A%3CLI%3EClick%20run%20query%20in%20the%20window.%3C%2FLI%3E%0A%3CLI%3EAn%20error%20message%20will%20appear%20saying%20that%20the%20content%20must%20be%20trusted%2C%20click%20the%20'add%20as%20trusted'%20button%20that%20appears.%3C%2FLI%3E%0A%3CLI%3ESave%20the%20setting%20and%20the%20workbook.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EThere%20are%20certain%20operators%20that%20cannot%20be%20checked%2C%20this%20may%20result%20in%20error.%20This%20applies%20to%20exercises%20that%20use%20extend%2C%20let%2C%20or%20externaldata.%3C%2FLI%3E%0A%3CLI%3EThis%20is%20the%20first%20release%20of%20the%20workbook.%20In%20future%20releases%20there%20will%20be%20more%20content%2C%20more%20exercises%2C%20and%20methods%20to%20upload%20custom%20exercises%20that%20allows%20users%20to%20pick%20and%20choose%20use%20cases%20that%20can%20help%20with%20job%20specific%20use%20cases.%3C%2FLI%3E%0A%3CLI%3EThe%20demo%20data%20provided%20is%20hosted%20within%20the%20public%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Ftree%2Fmaster%2FTools%2FIntrotoKQL%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EMicrosoft%20Sentinel%20GitHub%20repository%3C%2FA%3E.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EGo%20out%20and%20practice%20KQL%20today!%20If%20there%20are%20operators%20or%20exercises%20that%20you%20feel%20should%20be%20added%20to%20the%20workbook%2C%20please%20consider%20submitting%20feedback%20via%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2Fintrotokqlsurvey%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Eour%20form%3C%2FA%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-3055600%22%20slang%3D%22en-US%22%3E%3CP%3ELooking%20to%20start%20the%20new%20year%20with%20KQL%3F%20Looking%20for%20a%20hands-on%20method%20to%20do%20so%3F%20Look%20no%20further%20with%20this%20interactive%20KQL%20learning%20workbook%20in%20Microsoft%20Sentinel!%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Example.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F338815i9DD69CE20B07B741%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Example.gif%22%20alt%3D%22Example.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3055600%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EContent%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWorkbooks%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Jan 11 2022 05:53 PM
Updated by:
We support Ukraine and condemn war. Push Russian government to act against war. Be brave, vocal and show your support to Ukraine. Follow the latest news HERE