Hello harshmickey999,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you are in need of KQL query to fetch the Log Analytics Workspace in use for change tracking for Azure VMS.
The following Kusto Query Language (KQL) query should be helpful to fetch the Log Analytics Workspace in use for change tracking for Azure VMs.
// Query to find Log Analytics Workspace for change tracking
Resources
| where type == "microsoft.operationalinsights/workspaces"
| join kind=inner (
ResourceContainers
| where type == "microsoft.compute/virtualmachines"
) on subscriptionId
| project workspaceName = name, vmName = ResourceContainers.name
For more reading and specific VM resources utilization examples: https://www.geeksforgeeks.org/microsoft-azure-track-cpu-utilization-of-a-azure-virtual-machines-using-kql-log-query and https://curatedsql.com/2020/12/28/retrieving-azure-log-analytics-data-using-azure-data-factory/
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful ** so that others in the community facing similar issues can easily find the solution.
Best Regards,
Sina Salam