Forum Discussion
emmanuelnguyen
Apr 29, 2020Copper Contributor
Comment/Uncomment multiple lines
Hi all, Do you know a way to comment and uncomment multiple lines in the Logs Blade in Azure Sentinel ? I find it not convenient to type "//" every time. Is there a way to create a custom shortc...
Rod_Trent
Microsoft
Apr 29, 2020emmanuelnguyen You made me chuckle a little bit. Personally, I think its much easier to type two slashes (//) than some of the other remarking operators for other query and scripting platforms.
However, you can use something like AutoHotkey (https://www.autohotkey.com/) to develop your own keyboard shortcuts that and assign the KQL commenting operator to a custom keystroke combination.
I think its awesome that you're commenting, though. Commenting in the queries is a perfect example of a best practice for developing queries that can be shared and redistributed with colleagues and teammates, but also available to quickly comprehend at a later date.
emmanuelnguyen
Apr 30, 2020Copper Contributor
Rod_Trent I agree with you, that two slashes "//" are a good and fast way to comment one line. But I think it's too bad that there aren't a way to comment a block/multiple lines with only one shortcut, rather than typing "//" at each line.
What is weird is that in the command palette, as GaryBushey said, there is a command line for that "Toggle Block Comment" --> "Shift+Alt+A" but it's not working in my environment. And it seems that I'm not the only one.
Thank you for the recommendation about AutoHotkey, although I'm not certain that it will allow me to do this precise operation.
- Jaideep_SinghMay 04, 2022Copper Contributor
Not sure if it is too late to reply to this thread but I came across this and did a bit of search.
Control+K+C works for me to comment multiple lines in Kusto
Control+K+U is for uncommenting lines. Tested and it worked for me without any problems.
Seems these are the shortcuts used in Visual Studio too.
Hope this helps someone.