Forked from LeeHolmes/PowerShell Script Block Merge in Kusto
Created
March 25, 2022 22:38
-
-
Save mavjs/e6cbd87663adfef81d9e0d1e5662c5e4 to your computer and use it in GitHub Desktop.
Revisions
-
LeeHolmes created this gist
Mar 9, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ Event | where EventID == "4104" | extend ParsedEvent = parse_xml(strcat("<root>", ParameterXml, "</root>")) | extend MessageNumber = tolong(ParsedEvent.root.Param[0]) | extend MessageTotal = tolong(ParsedEvent.root.Param[1]) | extend ScriptBlockElement = iff( strlen(tostring(ParsedEvent.root.Param[2]["#text"])) > 0, ParsedEvent.root.Param[2]["#text"], ParsedEvent.root.Param[2]) | extend ScriptBlockId = tostring(ParsedEvent.root.Param[3]) | extend Path = ParsedEvent.root.Param[4] | order by MessageNumber asc | summarize TimeGenerated = min(TimeGenerated), Path = take_any(Path), ScriptBlockText = strcat_array(make_list(tostring(ScriptBlockElement)), "") by ScriptBlockId