%3CLINGO-SUB%20id%3D%22lingo-sub-1666621%22%20slang%3D%22en-US%22%3EMonitoring%20queries%20being%20executed%20in%20your%20Azure%20Log%20Analytics%20Workspaces%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1666621%22%20slang%3D%22en-US%22%3E%3CP%3EOne%20of%20the%20most%20requested%20features%20in%20Azure%20Monitor%20Logs%20is%20the%20ability%20to%20track%20the%20queries%20being%20executed%20in%20the%20system.%20Recently%2C%20we%20released%20to%20public%20preview%20the%20capability%20to%20meet%20all%20of%20these%20needs%3A%20the%20Query%20Audit%20Logs%20for%20Azure%20Log%20Analytics!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1267594802%22%20id%3D%22toc-hId--1267594802%22%3EA%20rich%20dataset%20to%20monitor%20your%20Workspace%3C%2FH2%3E%0A%3CP%3EThe%20feature%20was%20designed%20to%20answer%20questions%20around%20the%20areas%20of%20compliance%2C%20security%2C%20and%20performance%20of%20queries%20in%20the%20system.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20dataset%20that%20you%20will%20see%20once%20you%20enable%20the%20collection%20of%20the%20Query%20Audit%20Logs%20will%20include%20full%20information%20about%20each%20query%20executed.%20This%20includes%20information%20that%20will%20help%20you%20identify%20who%20ran%20the%20query%2C%20what%20application%20was%20used%20to%20run%20the%20query%2C%20and%20for%20successful%20queries%2C%20a%20full%20set%20of%20performance%20counters.%20The%20rich%20dataset%20will%20let%20you%20answer%20a%20wide%20variety%20of%20questions%3A%20from%20detecting%20malicious%20attempts%20to%20access%20sensitive%20data%2C%20to%20identifying%20queries%20that%20are%20particularly%20inefficient%2C%20and%20even%20detecting%20broken%20automation%20through%20consistently-failing%20queries%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1219918031%22%20id%3D%22toc-hId-1219918031%22%3ECollecting%20query%20audit%20logs%20is%20simple%3C%2FH2%3E%0A%3CP%3EFull%20details%20about%20how%20to%20enable%20and%20use%20the%20feature%20are%20available%20on%20our%20documentation%20page%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fazure-monitor%2Flog-query%2Fquery-audit%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20data-event%3D%22page-clicked-link%22%20data-bi-id%3D%22page-clicked-link%22%20data-bi-an%3D%22body%22%20data-bi-tn%3D%22undefined%22%3Ehere%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEnabling%20the%20collection%20of%20the%20query%20logs%20is%20simple%20%E2%80%93%20just%20open%20the%20workspace%20that%20you%20want%20to%20start%20tracking%20logs%20for%2C%20go%20to%20the%20diagnostic%20settings%2C%20and%20enable%20the%20collection%20of%20the%20query%20logs%20into%20any%20combination%20of%20a%20Storage%20Blob%2C%20Event%20Hub%2C%20and%2For%20(of%20course!)%20Azure%20Monitor%20Logs.%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorEvgeny%20Ternovsky_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%221.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218261i441392B4864C8FF6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%221.png%22%20alt%3D%221.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20prefer%20to%20use%20a%20programmatic%20approach%2C%20be%20it%20through%20an%20ARM%20template%20or%20Azure%20Policy%2C%20we%20provide%20full%20support%20for%20such%20an%20approach.%20You%E2%80%99ll%20find%20an%20example%20of%20an%20ARM%20template%20you%20can%20use%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fsamples%2Fresource-manager-diagnostic-settings%23diagnostic-setting-for-log-analytics-workspace%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--587536432%22%20id%3D%22toc-hId--587536432%22%3EAnswering%20a%20wide%20array%20of%20questions%3C%2FH2%3E%0A%3CP%3ESo%20what%20can%20you%20do%20with%20these%20query%20logs%20once%20you%20enable%20them%3F%20Below%20are%20just%20a%20few%20examples.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20see%20the%20number%20of%20queries%20each%20user%20in%20the%20system%20ran%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218258iE20808ACC8C91C42%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222.png%22%20alt%3D%222.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20response%20codes%20for%20these%20queries%2C%20useful%20for%20detection%20of%20failed%20logins%20(403s)%2C%20or%20broken%20automation%20(409s)%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%223.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218259i41EA31F4F599FC08%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%223.png%22%20alt%3D%223.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnd%20a%20list%20of%20the%20users%20most%20advanced%20in%20their%20knowledge%20of%20KQL%2C%20judged%20by%20the%20length%20of%20query%20they%20write%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%224.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218260i5091E10177981818%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%224.png%22%20alt%3D%224.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhile%20these%20are%20just%20a%20few%20examples%20to%20showcase%20the%20capabilities%20of%20these%20logs%2C%20many%20more%20questions%20can%20be%20answered%20-%20give%20it%20a%20go%20and%20see%20what%20insights%20you%20can%20come%20up%20with!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1899976401%22%20id%3D%22toc-hId-1899976401%22%3ENext%20Steps%3C%2FH2%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fazure-monitor%2Flog-query%2Fquery-audit%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20data-event%3D%22page-clicked-link%22%20data-bi-id%3D%22page-clicked-link%22%20data-bi-an%3D%22body%22%20data-bi-tn%3D%22undefined%22%3EEnable%20the%20collection%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eof%20the%20Query%20Audit%20Logs%20in%20Azure%20Monitor%20Logs%20today%2C%20and%20start%20getting%20visibility%20into%20how%20your%20Workspace%20is%20being%20used.%20Please%20do%20let%20us%20know%20of%20any%20questions%20or%20feedback%20you%20have%20around%20the%20feature%20-%20we're%20excited%20to%20see%20the%20creative%20ways%20in%20which%20these%20get%20used!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1666621%22%20slang%3D%22en-US%22%3E%3CP%3EOne%20of%20the%20most%20requested%20features%20in%20Azure%20Log%20Analytics%20is%20the%20ability%20to%20track%20the%20queries%20being%20executed%20in%20the%20system.%20Recently%2C%20we%20released%20to%20public%20preview%20the%20capability%20to%20meet%20all%20of%20these%20needs%3A%20the%20Query%20Audit%20Logs%20for%20Azure%20Log%20Analytics!%20Learn%20about%20them%20in%20this%20blog%20post.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1666621%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EUpdates%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E

One of the most requested features in Azure Monitor Logs is the ability to track the queries being executed in the system. Recently, we released to public preview the capability to meet all of these needs: the Query Audit Logs for Azure Log Analytics!

 

A rich dataset to monitor your Workspace

The feature was designed to answer questions around the areas of compliance, security, and performance of queries in the system.

 

The dataset that you will see once you enable the collection of the Query Audit Logs will include full information about each query executed. This includes information that will help you identify who ran the query, what application was used to run the query, and for successful queries, a full set of performance counters. The rich dataset will let you answer a wide variety of questions: from detecting malicious attempts to access sensitive data, to identifying queries that are particularly inefficient, and even detecting broken automation through consistently-failing queries

 

Collecting query audit logs is simple

Full details about how to enable and use the feature are available on our documentation page here.

 

Enabling the collection of the query logs is simple – just open the workspace that you want to start tracking logs for, go to the diagnostic settings, and enable the collection of the query logs into any combination of a Storage Blob, Event Hub, and/or (of course!) Azure Monitor Logs.

 

1.png

 

If you prefer to use a programmatic approach, be it through an ARM template or Azure Policy, we provide full support for such an approach. You’ll find an example of an ARM template you can use here.

 

Answering a wide array of questions

So what can you do with these query logs once you enable them? Below are just a few examples.

 

You can see the number of queries each user in the system ran:

2.png

 

The response codes for these queries, useful for detection of failed logins (403s), or broken automation (409s):

3.png

 

 

And a list of the users most advanced in their knowledge of KQL, judged by the length of query they write:

4.png

 

While these are just a few examples to showcase the capabilities of these logs, many more questions can be answered - give it a go and see what insights you can come up with!

 

Next Steps

Enable the collection of the Query Audit Logs in Azure Monitor Logs today, and start getting visibility into how your Workspace is being used. Please do let us know of any questions or feedback you have around the feature - we're excited to see the creative ways in which these get used!